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