]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: enable compile-time fmt format string checking 69537/head
authorKefu Chai <k.chai@proxmox.com>
Tue, 16 Jun 2026 12:19:11 +0000 (20:19 +0800)
committerKefu Chai <k.chai@proxmox.com>
Wed, 17 Jun 2026 08:54:51 +0000 (16:54 +0800)
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 <k.chai@proxmox.com>
src/CMakeLists.txt

index a93a38d7501f14e1a5ee3a0d85c97b53e94fe48c..a53365e1f7f32aa5b18d4fe71f1d202b85e172a5 100644 (file)
@@ -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