aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-19 11:36:22 -0800
committerChris Robinson <[email protected]>2023-12-19 11:36:22 -0800
commit59c466077fd6f16af64afcc6260bb61aa4e632dc (patch)
treeddefb8d2d838a47c09f9f2614d80d1144df4ccce
parentbfb35cec8a777e046b8e14e20d88cda74ed2daf5 (diff)
Use -static-libstdc++ to static link libstdc++
-rw-r--r--CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 59c0711e..f53236fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -329,7 +329,7 @@ else()
option(ALSOFT_STATIC_STDCXX "Static link libstdc++" OFF)
if(ALSOFT_STATIC_STDCXX)
set(OLD_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
- set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "-Wl,--push-state,-Bstatic,-lstdc++,--pop-state")
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "-static-libstdc++")
check_cxx_source_compiles("int main() { }" HAVE_STATIC_LIBSTDCXX_SWITCH)
set(CMAKE_REQUIRED_LIBRARIES ${OLD_REQUIRED_LIBRARIES})
unset(OLD_REQUIRED_LIBRARIES)
@@ -337,7 +337,7 @@ else()
if(NOT HAVE_STATIC_LIBSTDCXX_SWITCH)
message(FATAL_ERROR "Cannot static link libstdc++")
endif()
- set(LINKER_FLAGS ${LINKER_FLAGS} "-Wl,--push-state,-Bstatic,-lstdc++,--pop-state")
+ set(LINKER_FLAGS ${LINKER_FLAGS} "-static-libstdc++")
endif()
if(WIN32)