Skip to content

Commit c24a6ff

Browse files
committed
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 <[email protected]>
1 parent 35d08ae commit c24a6ff

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,9 @@ set(libcommon_files
443443
set_source_files_properties(ceph_ver.c
444444
APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h)
445445
add_library(common-objs OBJECT ${libcommon_files})
446+
target_link_libraries(common-objs legacy-option-headers)
446447
target_compile_definitions(common-objs PRIVATE
447448
$<TARGET_PROPERTY:${FMT_LIB},INTERFACE_COMPILE_DEFINITIONS>)
448-
add_dependencies(common-objs legacy-option-headers)
449449

450450
if(WITH_JAEGER)
451451
add_dependencies(common-objs jaeger_base)
@@ -542,8 +542,9 @@ if(WITH_BLUESTORE_PMEM OR WITH_RBD_RWL)
542542
endif()
543543

544544
add_library(common STATIC ${ceph_common_objs})
545-
target_link_libraries(common ${ceph_common_deps})
546-
add_dependencies(common legacy-option-headers)
545+
target_link_libraries(common
546+
${ceph_common_deps}
547+
legacy-option-headers)
547548
if(WITH_JAEGER)
548549
add_dependencies(common jaeger_base)
549550
endif()
@@ -561,7 +562,7 @@ if(ENABLE_COVERAGE)
561562
target_link_libraries(ceph-common gcov)
562563
endif(ENABLE_COVERAGE)
563564

564-
add_dependencies(ceph-common legacy-option-headers)
565+
target_link_libraries(ceph-common legacy-option-headers)
565566

566567
if(WITH_JAEGER)
567568
add_dependencies(ceph-common jaeger_base)

src/auth/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ endif()
2222

2323
add_library(common-auth-objs OBJECT ${auth_srcs})
2424
target_include_directories(common-auth-objs PRIVATE ${OPENSSL_INCLUDE_DIR})
25-
add_dependencies(common-auth-objs legacy-option-headers)
25+
target_link_libraries(common-auth-objs legacy-option-headers)

src/common/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ add_library(common_texttable_obj OBJECT
66

77
add_library(common_prioritycache_obj OBJECT
88
PriorityCache.cc)
9-
add_dependencies(common_prioritycache_obj legacy-option-headers)
9+
target_link_libraries(common_prioritycache_obj legacy-option-headers)
1010

1111
if(WIN32)
1212
add_library(dlfcn_win32 STATIC win32/dlfcn.cc win32/errno.cc)
@@ -193,7 +193,7 @@ target_compile_definitions(common-common-objs PRIVATE
193193
"CEPH_INSTALL_FULL_PKGLIBDIR=\"${CEPH_INSTALL_FULL_PKGLIBDIR}\""
194194
"CEPH_INSTALL_DATADIR=\"${CEPH_INSTALL_DATADIR}\""
195195
$<TARGET_PROPERTY:${FMT_LIB},INTERFACE_COMPILE_DEFINITIONS>)
196-
add_dependencies(common-common-objs legacy-option-headers)
196+
target_link_libraries(common-common-objs legacy-option-headers)
197197

198198
set(common_mountcephfs_srcs
199199
armor.c

src/compressor/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
add_library(compressor_objs OBJECT Compressor.cc)
22
add_dependencies(compressor_objs common-objs)
3-
add_dependencies(compressor_objs legacy-option-headers)
3+
target_link_libraries(compressor_objs legacy-option-headers)
44

55
if(HAVE_QATZIP AND HAVE_QAT)
66
add_library(qat_compressor OBJECT QatAccel.cc)

src/crimson/admin/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ add_library(crimson-admin STATIC
33
osd_admin.cc
44
pg_commands.cc)
55
target_link_libraries(crimson-admin
6+
legacy-option-headers
67
crimson::cflags
78
Boost::MPL)
8-
add_dependencies(crimson-admin
9-
legacy-option-headers)

src/global/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ else()
88
endif()
99

1010
add_library(libglobal_objs OBJECT ${libglobal_srcs})
11-
add_dependencies(libglobal_objs legacy-option-headers)
11+
target_link_libraries(libglobal_objs legacy-option-headers)
1212

1313
add_library(global-static STATIC
1414
$<TARGET_OBJECTS:libglobal_objs>)

0 commit comments

Comments
 (0)