From c24a6ffe20568d74f75af09bc83c636f51a2d3a2 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 20 Apr 2024 09:43:24 +0800 Subject: [PATCH] cmake: link against legacy-option-headers instead of depend on it since legacy-option-headers is now an interface library, we are now able to link against it instead of depending on it. this allows us to populate the dependency from the target linked against legacy-option-headers to the option headers files better. Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 9 +++++---- src/auth/CMakeLists.txt | 2 +- src/common/CMakeLists.txt | 4 ++-- src/compressor/CMakeLists.txt | 2 +- src/crimson/admin/CMakeLists.txt | 3 +-- src/global/CMakeLists.txt | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 73fa27ae34e..ccee64f6c4f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -443,9 +443,9 @@ set(libcommon_files 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}) +target_link_libraries(common-objs legacy-option-headers) target_compile_definitions(common-objs PRIVATE $) -add_dependencies(common-objs legacy-option-headers) if(WITH_JAEGER) add_dependencies(common-objs jaeger_base) @@ -542,8 +542,9 @@ if(WITH_BLUESTORE_PMEM OR WITH_RBD_RWL) endif() add_library(common STATIC ${ceph_common_objs}) -target_link_libraries(common ${ceph_common_deps}) -add_dependencies(common legacy-option-headers) +target_link_libraries(common + ${ceph_common_deps} + legacy-option-headers) if(WITH_JAEGER) add_dependencies(common jaeger_base) endif() @@ -561,7 +562,7 @@ if(ENABLE_COVERAGE) target_link_libraries(ceph-common gcov) endif(ENABLE_COVERAGE) -add_dependencies(ceph-common legacy-option-headers) +target_link_libraries(ceph-common legacy-option-headers) if(WITH_JAEGER) add_dependencies(ceph-common jaeger_base) diff --git a/src/auth/CMakeLists.txt b/src/auth/CMakeLists.txt index 1ab294332cb..014057f49be 100644 --- a/src/auth/CMakeLists.txt +++ b/src/auth/CMakeLists.txt @@ -22,4 +22,4 @@ endif() add_library(common-auth-objs OBJECT ${auth_srcs}) target_include_directories(common-auth-objs PRIVATE ${OPENSSL_INCLUDE_DIR}) -add_dependencies(common-auth-objs legacy-option-headers) +target_link_libraries(common-auth-objs legacy-option-headers) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 3deecc3f3d6..a5dcdd8ace6 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -6,7 +6,7 @@ add_library(common_texttable_obj OBJECT add_library(common_prioritycache_obj OBJECT PriorityCache.cc) -add_dependencies(common_prioritycache_obj legacy-option-headers) +target_link_libraries(common_prioritycache_obj legacy-option-headers) if(WIN32) add_library(dlfcn_win32 STATIC win32/dlfcn.cc win32/errno.cc) @@ -193,7 +193,7 @@ target_compile_definitions(common-common-objs PRIVATE "CEPH_INSTALL_FULL_PKGLIBDIR=\"${CEPH_INSTALL_FULL_PKGLIBDIR}\"" "CEPH_INSTALL_DATADIR=\"${CEPH_INSTALL_DATADIR}\"" $) -add_dependencies(common-common-objs legacy-option-headers) +target_link_libraries(common-common-objs legacy-option-headers) set(common_mountcephfs_srcs armor.c diff --git a/src/compressor/CMakeLists.txt b/src/compressor/CMakeLists.txt index 0da71aa1f1b..3da2710dab7 100644 --- a/src/compressor/CMakeLists.txt +++ b/src/compressor/CMakeLists.txt @@ -1,6 +1,6 @@ add_library(compressor_objs OBJECT Compressor.cc) add_dependencies(compressor_objs common-objs) -add_dependencies(compressor_objs legacy-option-headers) +target_link_libraries(compressor_objs legacy-option-headers) if(HAVE_QATZIP AND HAVE_QAT) add_library(qat_compressor OBJECT QatAccel.cc) diff --git a/src/crimson/admin/CMakeLists.txt b/src/crimson/admin/CMakeLists.txt index 36a5ae2a99d..0c4fd10fc58 100644 --- a/src/crimson/admin/CMakeLists.txt +++ b/src/crimson/admin/CMakeLists.txt @@ -3,7 +3,6 @@ add_library(crimson-admin STATIC osd_admin.cc pg_commands.cc) target_link_libraries(crimson-admin + legacy-option-headers crimson::cflags Boost::MPL) -add_dependencies(crimson-admin - legacy-option-headers) diff --git a/src/global/CMakeLists.txt b/src/global/CMakeLists.txt index a76b9469939..a6d3449e717 100644 --- a/src/global/CMakeLists.txt +++ b/src/global/CMakeLists.txt @@ -8,7 +8,7 @@ else() endif() add_library(libglobal_objs OBJECT ${libglobal_srcs}) -add_dependencies(libglobal_objs legacy-option-headers) +target_link_libraries(libglobal_objs legacy-option-headers) add_library(global-static STATIC $) -- 2.47.3