From ec727e2f6b51fb4c02185a1ceed466e0fc6930b1 Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Tue, 20 Jan 2015 13:32:38 -0600 Subject: [PATCH] -Wall for Clang/GCC --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31f73cf..f5c40d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,14 @@ if ( MSVC ) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W4 ") endif( MSVC ) +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # using regular Clang or AppleClang + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # using GCC + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +endif() + IF(JSONCPP_WITH_WARNING_AS_ERROR) UseCompilationWarningAsError() ENDIF(JSONCPP_WITH_WARNING_AS_ERROR)