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>
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
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>
add_library(heap_profiler STATIC
heap_profiler.cc)
target_link_libraries(heap_profiler
+ legacy-option-headers
gperftools::tcmalloc)
else()
add_library(heap_profiler STATIC