]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
build: Add `WITH_SYSTEM_FMT` option
authorAdam Emerson <aemerson@redhat.com>
Sat, 28 Oct 2023 17:42:59 +0000 (13:42 -0400)
committerAdam Emerson <aemerson@redhat.com>
Mon, 30 Oct 2023 14:54:30 +0000 (10:54 -0400)
The `WITH_SYSTEM_FMT` option builds against system fmt and will fail
if a suitable version is not found. It is defaulted to `OFF`.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
src/CMakeLists.txt

index deb27a1c36cfd71ca91f5882533fa96642da6c08..dca5e6e6d4ab78c7d5bda8ec0e1f1000f4e1cdd0 100644 (file)
@@ -326,7 +326,10 @@ if(NOT TARGET RapidJSON::RapidJSON)
 endif()
 
 option(WITH_FMT_HEADER_ONLY "use header-only version of fmt library" OFF)
-find_package(fmt 8.1.1...<10.0.0)
+option(WITH_SYSTEM_FMT "build against system fmt" OFF)
+if(WITH_SYSTEM_FMT)
+  find_package(fmt 8.1.1...<10.0.0 REQUIRED)
+endif()
 if(fmt_FOUND)
   message(STATUS "Building with system fmt.")
   if (WITH_FMT_HEADER_ONLY)