From: Sun Yuechi Date: Mon, 1 Jun 2026 06:52:03 +0000 (+0800) Subject: cmake: link legacy-option-headers from targets that use legacy options X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=35fadf93f5dcf7b7eaa66eed79765b1ea6c0aa83;p=ceph.git cmake: link legacy-option-headers from targets that use legacy options The *_legacy_options.h headers that define the legacy ConfigValues members are generated at build time by y2c.py. Linking the legacy-option-headers INTERFACE library adds an order dependency on that step. A few targets reference legacy members without linking it, so under a parallel build they can be compiled before the headers exist and fail with "class ConfigValues has no member ...": neorados_objs, neorados_api_obj - objecter_inflight_ops, ms_die_on_unhandled_msg (via Objecter.h / Messenger.h) ceph_zstd - compressor_zstd_level heap_profiler - log_file Link legacy-option-headers from them, as ceph_lz4, ceph_snappy and jerasure_utils already do. Signed-off-by: Sun Yuechi --- diff --git a/src/compressor/zstd/CMakeLists.txt b/src/compressor/zstd/CMakeLists.txt index 5a522840acf..fe964003022 100644 --- a/src/compressor/zstd/CMakeLists.txt +++ b/src/compressor/zstd/CMakeLists.txt @@ -13,7 +13,9 @@ set(zstd_sources CompressionPluginZstd.cc) add_library(ceph_zstd SHARED ${zstd_sources}) -target_link_libraries(ceph_zstd PRIVATE Zstd::Zstd $<$:ceph-common>) +target_link_libraries(ceph_zstd PRIVATE + legacy-option-headers + Zstd::Zstd $<$:ceph-common>) set_target_properties(ceph_zstd PROPERTIES VERSION 2.0.0 SOVERSION 2 diff --git a/src/neorados/CMakeLists.txt b/src/neorados/CMakeLists.txt index cc03ce61165..7421085f5ee 100644 --- a/src/neorados/CMakeLists.txt +++ b/src/neorados/CMakeLists.txt @@ -2,10 +2,12 @@ add_library(neorados_objs OBJECT RADOSImpl.cc) target_compile_definitions(neorados_objs PRIVATE $) +target_link_libraries(neorados_objs legacy-option-headers) add_library(neorados_api_obj OBJECT RADOS.cc) target_compile_definitions(neorados_api_obj PRIVATE $) +target_link_libraries(neorados_api_obj legacy-option-headers) add_library(libneorados STATIC $ diff --git a/src/perfglue/CMakeLists.txt b/src/perfglue/CMakeLists.txt index 9ad73d576e4..d64665d5005 100644 --- a/src/perfglue/CMakeLists.txt +++ b/src/perfglue/CMakeLists.txt @@ -2,6 +2,7 @@ if(ALLOCATOR STREQUAL "tcmalloc") add_library(heap_profiler STATIC heap_profiler.cc) target_link_libraries(heap_profiler + legacy-option-headers gperftools::tcmalloc) else() add_library(heap_profiler STATIC