From 1d18b19997d3bbcd4f7d82d8430a3d63986cea9f Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 16 Jun 2026 20:19:11 +0800 Subject: [PATCH] cmake: enable compile-time fmt format string checking seastar checks log format strings at compile time when Seastar_LOGGER_COMPILE_TIME_FMT is on; the option is gated on fmt_VERSION >= 9.0.0. ceph builds fmt via add_subdirectory(), which leaves the version in fmt's own FMT_VERSION and never sets the lowercase fmt_VERSION the option reads, so the check was silently off for crimson. read the version off the fmt target and expose it so the option turns on. Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a93a38d7501f..a53365e1f7f3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -446,6 +446,8 @@ else() set(BUILD_SHARED_LIBS ${old_BUILD_SHARED_LIBS}) unset(old_BUILD_SHARED_LIBS) include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/src/fmt/include") + get_target_property(FMT_VERSION fmt VERSION) + set(fmt_VERSION "${FMT_VERSION}") endif() # in osd/PeeringState.h, the number of elements in PeeringState::Active::reactions -- 2.47.3