diff options
author | Allen Winter <allen.winter@kdab.com> | 2018-01-21 16:34:30 -0500 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2018-01-21 16:34:30 -0500 |
commit | d9244fa3dce4ab337a9559c9b29bb62c92bf6758 (patch) | |
tree | b608f4d0db96a288b9a857c6af747a8ddcb812fd | |
parent | c1218563197651f5eb7c2686c26425adb7a2fecc (diff) | |
download | libical-git-d9244fa3dce4ab337a9559c9b29bb62c92bf6758.tar.gz |
CMakeLists.txt - handle clang COMPILER_ID on Mac is "AppleClang".
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 99685ec7..43252ae5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -407,7 +407,7 @@ endif() # # Compiler settings # -if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") +if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang") include(CheckCCompilerFlag) check_c_compiler_flag(-Wunused-but-set-variable HAVE_GCC_UNUSED_BUT_SET) check_c_compiler_flag(-Wlogical-op HAVE_GCC_LOGICAL_OP) @@ -434,11 +434,11 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE -D_GNU_SOURCE") endif() endif() -if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") +if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments") endif() -if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-Wunused-but-set-variable HAVE_GXX_UNUSED_BUT_SET) check_cxx_compiler_flag(-Wlogical-op HAVE_GXX_LOGICAL_OP) @@ -469,7 +469,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE -D_GNU_SOURCE") endif() endif() -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments") endif() @@ -487,7 +487,7 @@ endif() option(ADDRESS_SANITIZER "Build with the address sanitizer." False) if(ADDRESS_SANITIZER) - if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -g") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g") else() @@ -512,7 +512,7 @@ endif() option(THREAD_SANITIZER "Build with the thread sanitizer." False) if(THREAD_SANITIZER) - if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -O1 -g") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -O1 -g") else() |