diff --git a/CMakeLists.txt b/CMakeLists.txt index 738fc0a6..211cdda0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ if(NOT WIN32 AND NOT APPLE) set(GUI gtk2 CACHE STRING "GUI toolkit to use (one of: gtk2 gtk3)") endif() -if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) # GCC 4.8/4.9 ship with broken but present . meh. message(FATAL_ERROR "GCC 5.0+ is required") @@ -54,7 +54,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") endif() if(SANITIZE) - if(NOT (CMAKE_C_COMPILER_ID STREQUAL Clang AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)) + if(NOT (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) message(ERROR "Sanitizers are only available in Clang/Clang++") endif() set(SANITIZE_FLAGS "-O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls") @@ -166,9 +166,9 @@ if(MSVC) set(WARNING_FLAGS "${WARNING_FLAGS} /we4062") endif() -if(CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(WARNING_FLAGS "-Wall -Wextra -Wno-unused-parameter") - if(CMAKE_CXX_COMPILER_ID STREQUAL Clang) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(WARNING_FLAGS "${WARNING_FLAGS} -Wfloat-conversion") endif() # We rely on these -Werror flags. diff --git a/cmake/DisableWarnings.cmake b/cmake/DisableWarnings.cmake index 372e4408..b79ef9cd 100644 --- a/cmake/DisableWarnings.cmake +++ b/cmake/DisableWarnings.cmake @@ -1,15 +1,15 @@ # Disables all warnings on MSVC and GNU-compatible compilers. function(disable_warnings) - if(CMAKE_C_COMPILER_ID STREQUAL GNU OR CMAKE_C_COMPILER_ID STREQUAL Clang) + if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w" PARENT_SCOPE) - elseif(CMAKE_C_COMPILER_ID STREQUAL MSVC) + elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0" PARENT_SCOPE) endif() - if(CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w" PARENT_SCOPE) - elseif(CMAKE_CXX_COMPILER_ID STREQUAL MSVC) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0" PARENT_SCOPE) endif() endfunction()