b08661
From 1207906fcf005812f1d861e7bf577a1dc2d1e053 Mon Sep 17 00:00:00 2001
b08661
From: Boris Ranto <branto@redhat.com>
b08661
Date: Thu, 5 Aug 2021 15:59:39 +0200
b08661
Subject: [PATCH] cmake: link bundled fmt statically
b08661
b08661
instead of building the bundled fmt library as shared library, built
b08661
static library. otherwise we'd have to link against libfmt.so.
b08661
b08661
Signed-off-by: Kefu Chai <kchai@redhat.com>
b08661
---
b08661
 src/CMakeLists.txt | 4 ++++
b08661
 1 file changed, 4 insertions(+)
b08661
b08661
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
b08661
index c4d73633ed8..b1a9001e744 100644
b08661
--- a/src/CMakeLists.txt
b08661
+++ b/src/CMakeLists.txt
b08661
@@ -310,7 +310,11 @@ if(fmt_FOUND)
b08661
   include_directories(SYSTEM "${fmt_INCLUDE_DIR}")
b08661
 else()
b08661
   message(STATUS "Could not find fmt, will build it")
b08661
+  set(old_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
b08661
+  set(BUILD_SHARED_LIBS FALSE)
b08661
   add_subdirectory(fmt)
b08661
+  set(BUILD_SHARED_LIBS ${old_BUILD_SHARED_LIBS})
b08661
+  unset(old_BUILD_SHARED_LIBS)
b08661
   include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/src/fmt/include")
b08661
 endif()
b08661
 
b08661
-- 
b08661
2.31.1
b08661