From f20f24edcb88ca21ca1cdf28b762f665b6efa365 Mon Sep 17 00:00:00 2001 From: zhongkaizhu Date: Thu, 14 May 2020 21:17:56 +0800 Subject: [PATCH] build: static link libstdc++ and libgcc --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b2b6976..3de5851 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -179,6 +179,7 @@ elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux") set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-Wl,-rpath=/opt/lib/android/" BUILD_WITH_INSTALL_RPATH 1) + target_link_options(${PROJECT_NAME} PRIVATE -static-libgcc -static-libstdc++) elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin") FIND_LIBRARY(IOKit_LIBRARY IOKit) FIND_LIBRARY(Foundation_LIBRARY Foundation)