From 004c442fdf7a80aedf5e33aff9e4d24c90ac238a Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 12 Mar 2023 22:37:52 +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 029cc4511..5a46f27ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,6 +149,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()