]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: link legacy-option-headers from targets that use legacy options 69215/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Mon, 1 Jun 2026 06:52:03 +0000 (14:52 +0800)
committerSun Yuechi <sunyuechi@iscas.ac.cn>
Mon, 1 Jun 2026 11:41:15 +0000 (19:41 +0800)
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 <sunyuechi@iscas.ac.cn>
src/compressor/zstd/CMakeLists.txt
src/neorados/CMakeLists.txt
src/perfglue/CMakeLists.txt

index 5a522840acf95b176bb8741b49c79c6247ee6f6a..fe964003022f66100079f48ec4ff18c5130ae3cc 100644 (file)
@@ -13,7 +13,9 @@ set(zstd_sources
   CompressionPluginZstd.cc)
 
 add_library(ceph_zstd SHARED ${zstd_sources})
-target_link_libraries(ceph_zstd PRIVATE Zstd::Zstd $<$<PLATFORM_ID:Windows>:ceph-common>)
+target_link_libraries(ceph_zstd PRIVATE
+  legacy-option-headers
+  Zstd::Zstd $<$<PLATFORM_ID:Windows>:ceph-common>)
 set_target_properties(ceph_zstd PROPERTIES
   VERSION 2.0.0
   SOVERSION 2
index cc03ce61165004c5be0c7eaf4056c1ceec3b47ae..7421085f5ee6bcd702e067026078499040c91f17 100644 (file)
@@ -2,10 +2,12 @@ add_library(neorados_objs OBJECT
   RADOSImpl.cc)
 target_compile_definitions(neorados_objs PRIVATE
   $<TARGET_PROPERTY:${FMT_LIB},INTERFACE_COMPILE_DEFINITIONS>)
+target_link_libraries(neorados_objs legacy-option-headers)
 add_library(neorados_api_obj OBJECT
   RADOS.cc)
 target_compile_definitions(neorados_api_obj PRIVATE
   $<TARGET_PROPERTY:${FMT_LIB},INTERFACE_COMPILE_DEFINITIONS>)
+target_link_libraries(neorados_api_obj legacy-option-headers)
 
 add_library(libneorados STATIC
   $<TARGET_OBJECTS:neorados_api_obj>
index 9ad73d576e4e557b566d53bb25df24e8df6903b5..d64665d500549292fcafcd4d6e4b60026ef3ea0b 100644 (file)
@@ -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