From 752ce0f6b0a38299925e61e03a54b24e49a3a155 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期三, 18 五月 2022 10:52:00 +0800
Subject: [PATCH] static linked c++

---
 src/CMakeLists.txt |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8e73250..9d4ad67 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -3,6 +3,12 @@
 
 set(CMAKE_SHARED_LINKER_FLAGS  ${CMAKE_SHARED_LINKER_FLAGS} "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exported_symbols")
 
+# static link c++
+Append(CMAKE_C_FLAGS "-static-libstdc++ -static-libgcc")
+Append(CMAKE_CXX_FLAGS "-static-libstdc++ -static-libgcc")
+Append(CMAKE_CXX_FLAGS_RELEASE "-static-libstdc++ -static-libgcc")
+Append(CMAKE_CXX_FLAGS_DEBUG "-static-libstdc++ -static-libgcc")
+
 include_directories(${CMAKE_SOURCE_DIR}/nng-1.5.2/include)
 
 include_directories(${CMAKE_BINARY_DIR}/proto)

--
Gitblit v1.8.0