diff options
author | Kevin Funk <kfunk@kde.org> | 2017-04-04 19:38:03 +0200 |
---|---|---|
committer | Kevin Funk <kfunk@kde.org> | 2017-04-05 14:52:34 +0200 |
commit | c20a9f69e8e2703cf42f320f26db122f3a6733df (patch) | |
tree | 0270e2893023308204b02ed1bd8ca2ec6bd3924f | |
parent | 47a4c068a4ecbd488675f221492e3244a44d21de (diff) | |
download | extra-cmake-modules-c20a9f69e8e2703cf42f320f26db122f3a6733df.tar.gz extra-cmake-modules-c20a9f69e8e2703cf42f320f26db122f3a6733df.tar.bz2 |
Use -Wno-gnu-zero-variadic-macro-arguments more
Summary:
Add it to KDECompilerSettings.cmake instead of
KDEFrameworkCompilerSettings.cmake.
Users can then just enable -pedantic without worrying about the
gnu-zero-variadic-macro-arguments warning.
This fixes some warnings in e.g. kdenlive
Reviewers: kossebau, apol, dfaure
Reviewed By: apol
Subscribers: apol, #frameworks, #build_system
Tags: #frameworks, #build_system
Differential Revision: https://phabricator.kde.org/D5302
-rw-r--r-- | kde-modules/KDECompilerSettings.cmake | 6 | ||||
-rw-r--r-- | kde-modules/KDEFrameworkCompilerSettings.cmake | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/kde-modules/KDECompilerSettings.cmake b/kde-modules/KDECompilerSettings.cmake index 550f5250..781fc384 100644 --- a/kde-modules/KDECompilerSettings.cmake +++ b/kde-modules/KDECompilerSettings.cmake @@ -353,6 +353,12 @@ if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT APPLE) OR endif() set(_KDE_GCC_COMMON_WARNING_FLAGS "-Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef") +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # -Wgnu-zero-variadic-macro-arguments (part of -pedantic) is triggered by every qCDebug() call and therefore results + # in a lot of noise. This warning is only notifying us that clang is emulating the GCC behaviour + # instead of the exact standard wording so we can safely ignore it + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments") +endif() if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_KDE_GCC_COMMON_WARNING_FLAGS} -Wmissing-format-attribute -Wwrite-strings") # Make some warnings errors diff --git a/kde-modules/KDEFrameworkCompilerSettings.cmake b/kde-modules/KDEFrameworkCompilerSettings.cmake index a96d3fb5..7d30ec66 100644 --- a/kde-modules/KDEFrameworkCompilerSettings.cmake +++ b/kde-modules/KDEFrameworkCompilerSettings.cmake @@ -61,14 +61,12 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(-DQT_STRICT_ITERATORS) endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") +endif() + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override" ) endif() -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - # -Wgnu-zero-variadic-macro-arguments is triggered by every qCDebug() call and therefore results - # in a lot of noise. This warning is only notifying us that clang is emulating the GCC behaviour - # instead of the exact standard wording so we can safely ignore it - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-gnu-zero-variadic-macro-arguments") endif() |