From: Lucian Petrut Date: Mon, 21 Aug 2023 06:27:24 +0000 (+0000) Subject: cmake: honor WITH_FMT_HEADER_ONLY with vendored fmt lib X-Git-Tag: v19.0.0~575^2~13 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a09b70dfd8ebfab3b641206568a8c6f9b3d6404d;p=ceph-ci.git cmake: honor WITH_FMT_HEADER_ONLY with vendored fmt lib 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 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2d2d7f67ee4..21f83a44b67 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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")