summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-01-19 10:51:07 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-01-22 15:58:05 +0000
commit9a683152c3f59564e84f7aeca37eb0fd7981d219 (patch)
treeb8730d6ab5ad3d80df614b682343306dc0a883a6 /cmake
parent4eb7b7d38b9ed9b1feb78ac1257ef8a671d07bb2 (diff)
downloadrspamd-9a683152c3f59564e84f7aeca37eb0fd7981d219.tar.gz
rspamd-9a683152c3f59564e84f7aeca37eb0fd7981d219.zip
[Project] Allow static libstdc++
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Toolset.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/Toolset.cmake b/cmake/Toolset.cmake
index 77c87f18a..10f682915 100644
--- a/cmake/Toolset.cmake
+++ b/cmake/Toolset.cmake
@@ -1,5 +1,6 @@
option (ENABLE_FAST_MATH "Build rspamd with fast math compiler flag [default: ON]" ON)
option (ENABLE_ANALYZER "Build rspamd with static analyzer [default: OFF]" OFF)
+option (ENABLE_STATIC_LIBCXX "Build rspamd with static lib(std)c++ [default: OFF]" OFF)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
SET (COMPILER_GCC 1)
@@ -193,5 +194,13 @@ else ()
message (STATUS "IPO not enabled for the ${CMAKE_BUILD_TYPE} build")
endif ()
+if (ENABLE_STATIC_LIBCXX MATCHES "ON")
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++")
+endif()
+
message (STATUS "Final CFLAGS: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
message (STATUS "Final CXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
+message (STATUS "Final link flags for shlib: ${CMAKE_SHARED_LINKER_FLAGS}")
+message (STATUS "Final link flags for exe: ${CMAKE_EXE_LINKER_FLAGS}")
+