From 4643ba0adc3ccac20b88c73834f644e2fe223a7e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 21 Jun 2017 07:10:38 -0400 Subject: [PATCH] Clang: improve usefullness of clang-warnings - don't check c++98 compatibility - don't show warnings on third-party code - don't check for padding --- CMakeLists.txt | 2 +- thirdparty/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5942e6354..89e44e93e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) set( CMAKE_C_FLAGS_RELEASE "-O4 -DNDEBUG" ) set( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" ) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-c++98-compat -Wno-padded" ) set( CMAKE_CXX_FLAGS_DEBUG "-g" ) set( CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG" ) set( CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG" ) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index b3401a977..77b4897a5 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -1,3 +1,8 @@ +if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) + # Suppress warnings entirely; not interesting in third-party code + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w" ) +endif() + if( WITH_CRASHREPORTER ) macro( qt_wrap_ui ) qt5_wrap_ui( ${ARGN} )