From 9bf5786bde99b4b2a18fc60d6316fdeaaf7ae6a3 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 12 Mar 2023 22:39:48 +0300 Subject: [PATCH] Statically link libstdc++ and libgcc when memprof is enabled. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a1928a..bb69849 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,9 @@ if (CLANG OR GCC) elseif (APPLE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_pie") endif() + include(AddCXXCompilerFlag) + add_cxx_compiler_flag("-static-libstdc++") + add_cxx_compiler_flag("-static-libgcc") endif() endif()