From cdd490b53ccbb31ebdd5f518f3ab15b83e7a76e5 Mon Sep 17 00:00:00 2001 From: Nicolas Hake Date: Sat, 14 Feb 2015 00:11:51 +0100 Subject: [PATCH] Set some warning flags when compiling with clang The Clang warning flags are woefully underdocumented, so I've just matched the g++ list in as much as I knew the flags existed. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb3819775..5b1fe0015 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,6 +124,10 @@ if(CMAKE_COMPILER_IS_GNUCXX) list(APPEND OC_CXX_FLAGS "-Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual") endif() +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + list(APPEND OC_CXX_FLAGS "-Wall -Wextra -Wextra-tokens -Wpointer-arith -Wcast-align -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual") +endif() + if(WIN32 AND MINGW) # Activate DEP and ASLR list(APPEND OC_EXE_LINKER_FLAGS "-Wl,--nxcompat -Wl,--dynamicbase")