From: Kefu Chai Date: Tue, 16 Jun 2026 12:19:11 +0000 (+0800) Subject: cmake: enable compile-time fmt format string checking X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1d18b19997d3bbcd4f7d82d8430a3d63986cea9f;p=ceph.git 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 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a93a38d7501..a53365e1f7f 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