more concise this way, without yet another redirection.
Signed-off-by: Kefu Chai <kchai@redhat.com>
CHECK_TYPE_SIZE(suseconds_t SUSECONDS_T)
unset(CMAKE_EXTRA_INCLUDE_FILES)
-function(compile_with_fmt target)
- get_target_property(fmt_compile_definitions
- fmt::fmt INTERFACE_COMPILE_DEFINITIONS)
- if(fmt_compile_definitions)
- target_compile_definitions(${target} PUBLIC
- ${fmt_compile_definitions})
- endif()
-endfunction()
-
set(libcommon_files
${CMAKE_BINARY_DIR}/src/include/ceph_ver.h
ceph_ver.c
set_source_files_properties(ceph_ver.c
APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h)
add_library(common-objs OBJECT ${libcommon_files})
-compile_with_fmt(common-objs)
+target_compile_definitions(common-objs PRIVATE
+ $<TARGET_PROPERTY:fmt::fmt,INTERFACE_COMPILE_DEFINITIONS>)
add_dependencies(common-objs legacy-option-headers)
if(WITH_JAEGER)
target_compile_definitions(common-common-objs PRIVATE
"CMAKE_INSTALL_LIBDIR=\"${CMAKE_INSTALL_LIBDIR}\""
"CEPH_INSTALL_FULL_PKGLIBDIR=\"${CEPH_INSTALL_FULL_PKGLIBDIR}\""
- "CEPH_INSTALL_DATADIR=\"${CEPH_INSTALL_DATADIR}\"")
-compile_with_fmt(common-common-objs)
+ "CEPH_INSTALL_DATADIR=\"${CEPH_INSTALL_DATADIR}\""
+ $<TARGET_PROPERTY:fmt::fmt,INTERFACE_COMPILE_DEFINITIONS>)
add_dependencies(common-common-objs legacy-option-headers)
set(common_mountcephfs_srcs
endif()
add_library(common-msg-objs OBJECT ${msg_srcs})
-compile_with_fmt(common-msg-objs)
+target_compile_definitions(common-msg-objs PRIVATE
+ $<TARGET_PROPERTY:fmt::fmt,INTERFACE_COMPILE_DEFINITIONS>)
target_include_directories(common-msg-objs PRIVATE ${OPENSSL_INCLUDE_DIR})
if(WITH_DPDK)
add_library(neorados_objs OBJECT
RADOSImpl.cc)
-compile_with_fmt(neorados_objs)
+target_compile_definitions(neorados_objs PRIVATE
+ $<TARGET_PROPERTY:fmt::fmt,INTERFACE_COMPILE_DEFINITIONS>)
add_library(neorados_api_obj OBJECT
RADOS.cc)
-compile_with_fmt(neorados_api_obj)
+target_compile_definitions(neorados_api_obj PRIVATE
+ $<TARGET_PROPERTY:fmt::fmt,INTERFACE_COMPILE_DEFINITIONS>)
add_library(libneorados STATIC
$<TARGET_OBJECTS:neorados_api_obj>