From 0678775852392cc39da58db8c1e75496784c1974 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 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3921dfe..ee68d6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,11 +16,18 @@ 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 ) if( MSVC )