]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: honor WITH_FMT_HEADER_ONLY with vendored fmt lib
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Mon, 21 Aug 2023 06:27:24 +0000 (06:27 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Mon, 21 Aug 2023 06:39:26 +0000 (06:39 +0000)
We're using the vendored fmt lib when there is no system library
available. However, there is an inconsistency: the
WITH_FMT_HEADER_ONLY setting is ignored by the vendored library.

In order to address this, we'll use the fmt-header-only alias
if WITH_FMT_HEADER_ONLY is set.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/CMakeLists.txt

index 2d2d7f67ee41aee561810d6b478be75ab0d999ea..21f83a44b67771fe075f755d01bcbaabe2d7b3fa 100644 (file)
@@ -335,6 +335,9 @@ else()
   set(old_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
   set(BUILD_SHARED_LIBS FALSE)
   add_subdirectory(fmt)
+  if (WITH_FMT_HEADER_ONLY)
+    add_library(fmt::fmt ALIAS fmt-header-only)
+  endif()
   set(BUILD_SHARED_LIBS ${old_BUILD_SHARED_LIBS})
   unset(old_BUILD_SHARED_LIBS)
   include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/src/fmt/include")