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". --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9cd54dbe..06acecf2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -144,7 +144,7 @@ if (WIN32 OR CYGWIN) endif() if (CMAKE_BUILD_TYPE STREQUAL "Debug") - if (CMAKE_CXX_COMPILER MATCHES "clang\\+\\+") + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_definitions( # -Weverything # -Wno-disabled-macro-expansion @@ -199,7 +199,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug") DEPENDS ${_header_filename}) endmacro(ADD_PCH_RULE _header_filename _src_list _other_srcs) - elseif (CMAKE_CXX_COMPILER MATCHES "g\\+\\+") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(GXX_WARNING_FLAGS -pedantic -Wall -- cgit v1.2.3