From 53eeeab0e39a9079324f8aad39a6ca0f446030e1 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 6 Apr 2022 12:54:40 +0100 Subject: [PATCH] CMakeLists.txt: also match 'AppleClang' compiler to not link with libc++ --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3259ca90c..9a1d9032f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -462,7 +462,9 @@ if (UNIX OR MINGW) link_libraries(-Bsymbolic-functions) endif () - if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # As of CMake 3.0.0, the compiler id for Apple-provided Clang is now "AppleClang"; + # thus we use MATCHES instead of STREQUAL to include either regular Clang or AppleClang + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Make sure we don't link to libstdc++ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions") set (CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "m") # libm