]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: link bundled fmt statically 42692/head
authorKefu Chai <kchai@redhat.com>
Thu, 5 Aug 2021 13:52:50 +0000 (21:52 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 6 Aug 2021 01:15:53 +0000 (09:15 +0800)
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 <kchai@redhat.com>
(cherry picked from commit ebbf7f0665487b9e0507f1550cd469e56895addc)

src/CMakeLists.txt

index 011408ceb958d3aa19d5956c14c3a9b965114268..e31bf0c50c6f7e9345a42cb74bb9f2ff89bdfa85 100644 (file)
@@ -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()