From: Kefu Chai Date: Thu, 5 Aug 2021 13:52:50 +0000 (+0800) Subject: cmake: link bundled fmt statically X-Git-Tag: v16.2.6~66^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F42692%2Fhead;p=ceph.git cmake: link bundled fmt statically instead of building the bundled fmt library as shared library, built static library. otherwise we'd have to link against libfmt.so. Signed-off-by: Kefu Chai (cherry picked from commit ebbf7f0665487b9e0507f1550cd469e56895addc) --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 011408ceb958..e31bf0c50c6f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -309,7 +309,11 @@ if(fmt_FOUND) include_directories(SYSTEM "${fmt_INCLUDE_DIR}") else() message(STATUS "Could not find fmt, will build it") + set(old_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) + set(BUILD_SHARED_LIBS FALSE) add_subdirectory(fmt) + set(BUILD_SHARED_LIBS ${old_BUILD_SHARED_LIBS}) + unset(old_BUILD_SHARED_LIBS) include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/src/fmt/include") endif()