cmake: use -Wall on GCC and Clang

These checks come from [1]. The `MATCHES` operator is used for clang
because of Apple's special string.

[1] http://stackoverflow.com/questions/10046114/in-cmake-how-can-i-test-if-the-compiler-is-clang/10055571#10055571
This commit is contained in:
Jan Kundrát 2016-11-22 10:31:01 +01:00
parent 1c31800210
commit f058d3aa74
1 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,10 @@ include(CTest)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}")
endif()
add_library(spdlog INTERFACE)
option(SPDLOG_BUILD_EXAMPLES "Build examples" OFF)