From 38a320c1774fbbfaeea023be6662b3c7501f303c Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Thu, 21 Dec 2017 22:45:39 +0100 Subject: [PATCH] fix static compile with non gnu compiler remove adding compiler flags `-static-...` if compiler is not a gnu compiler --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8bf8e8c2..10f33bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -443,7 +443,9 @@ if(CMAKE_LINK_STATIC) set(BUILD_SHARED_LIBRARIES OFF) set(DL_LIB ${CMAKE_DL_LIBS}) set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") - set(LIBS "-static-libgcc -static-libstdc++ ${LIBS}") + if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "GNU") + set(LIBS "-static-libgcc -static-libstdc++ ${LIBS}") + endif() endif() # compile C files