]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: link bundled fmt statically 42681/head
authorKefu Chai <kchai@redhat.com>
Thu, 5 Aug 2021 13:52:50 +0000 (21:52 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 5 Aug 2021 13:53:55 +0000 (21:53 +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>
src/CMakeLists.txt

index d190c481afea93e8f25d89d4903413ace16c526a..a192a79affbd62ce572f96db238e113ceaee2678 100644 (file)
@@ -328,7 +328,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()