From 1116472dce6523ce18a7a9ea9376aac8bed9f864 Mon Sep 17 00:00:00 2001 From: Tim Landscheidt Date: Sat, 26 Jan 2019 17:40:21 +0000 Subject: Use CMAKE_CXX_COMPILER_ID for conditions based on compiler CMAKE_CXX_COMPILER is the path to the compiler binary and does not need to follow a specific pattern. For example, on Linux with GCC and without an explicit "-DCMAKE_CXX_COMPILER:PATH=" option, CMAKE_CXX_COMPILER is "/usr/bin/c++" which does not match "g++". CMAKE_CXX_COMPILER_ID however will always reliably be "Clang" or "GNU". --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index c85a5157..c2c27097 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,8 +296,7 @@ configure_file( ${PROJECT_SOURCE_DIR}/src/system.hh.in ${PROJECT_BINARY_DIR}/system.hh) -if((CMAKE_CXX_COMPILER MATCHES "clang") OR - (CMAKE_CXX_COMPILER MATCHES "clang\\+\\+")) +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ") endif() -- cgit v1.2.3