From 8ca131e4cd336f5726c451e07fcacddff317eabd Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Wed, 25 Jan 2023 10:43:06 -0500 Subject: [PATCH] - use static standard libraries for Linux --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3921dfe..d7487e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,9 +16,17 @@ ENDIF( NOT CMAKE_BUILD_TYPE ) set( SSE_MATTERS NO ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(MACOSX TRUE) +endif() + if( CMAKE_COMPILER_IS_GNUCXX ) set( GPROF 0 CACHE BOOL "Enable profiling with gprof for Debug and RelWithDebInfo build types." ) set( PROFILE 0 CACHE INT "1=Generate profile coverage info, 2=Use it" ) + if (NOT MACOSX) + set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -static -static-libgcc -static-libstdc++") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++") + endif() endif( CMAKE_COMPILER_IS_GNUCXX ) find_package( ZLIB )