diff options
Diffstat (limited to 'mkspecs/features/qt_common.prf')
-rw-r--r-- | mkspecs/features/qt_common.prf | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf index 6512fb1db2..59e08fc124 100644 --- a/mkspecs/features/qt_common.prf +++ b/mkspecs/features/qt_common.prf @@ -48,6 +48,21 @@ contains(TEMPLATE, .*lib) { # as the host compiler's version and capabilities are not checked. host_build:cross_compile: return() +# Extra warnings for Qt non-example code, to ensure cleanliness of the sources. +# The block below may turn these warnings into errors for some Qt targets. +# -Wdate-time: warn if we use __DATE__ or __TIME__ (we want to be able to reproduce the exact same binary) +# -Wvla: use of variable-length arrays (an extension to C++) +clang { + # Clang 3.5 introduced -Wdate-time + # The conditional assumes we aren't compiling against Clang 2.x anymore + greaterThan(QT_CLANG_MAJOR_VERSION, 3)|greaterThan(QT_CLANG_MINOR_VERSION, 4): \ + QMAKE_CXXFLAGS_WARN_ON += -Wdate-time +} else: gcc:!intel_icc { + QMAKE_CXXFLAGS_WARN_ON += -Wvla + # GCC 5 introduced -Wdate-time + greaterThan(QT_GCC_MAJOR_VERSION, 4): QMAKE_CXXFLAGS_WARN_ON += -Wdate-time +} + warnings_are_errors:warning_clean { # If the module declares that it has does its clean-up of warnings, enable -Werror. # This setting is compiler-dependent anyway because it depends on the version of the @@ -61,9 +76,9 @@ warnings_are_errors:warning_clean { QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR } } else:intel_icc:linux { - # Intel CC 13.0 - 16.0, on Linux only + # Intel CC 13.0 - 17.0, on Linux only ver = $${QT_ICC_MAJOR_VERSION}.$${QT_ICC_MINOR_VERSION} - linux:contains(ver, "(1[345]\\.|16\\.0)") { + linux:contains(ver, "(1[3456]\\.|17\\.0)") { # 177: function "entity" was declared but never referenced # (too aggressive; ICC reports even for functions created due to template instantiation) # 1224: #warning directive @@ -85,9 +100,9 @@ warnings_are_errors:warning_clean { # Work-around for bug https://code.google.com/p/android/issues/detail?id=58135 android: QMAKE_CXXFLAGS_WARN_ON += -Wno-error=literal-suffix } - } else:msvc { - # enable for MSVC 2012, MSVC 2013 - equals(MSVC_VER, "11.0")|equals(MSVC_VER, "12.0"): QMAKE_CXXFLAGS_WARN_ON += -WX + } else:msvc:!intel_icl { + # enable for MSVC 2012, MSVC 2013, MSVC 2015 + contains(MSVC_VER, "1[124].0"): QMAKE_CXXFLAGS_WARN_ON += -WX } unset(ver) } |