Update C++11 warning logic from QtWebKit
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Fri, 30 Jan 2015 10:54:44 +0000 (11:54 +0100)
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Tue, 10 Feb 2015 11:25:28 +0000 (11:25 +0000)
Fixes compatibility with gcc 5.0.

Change-Id: I017c6d690c1f64359c3bac6c8b6b0f5e089861eb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/3rdparty/masm/masm.pri

index 3fd4aa6..3655af3 100644 (file)
@@ -71,18 +71,16 @@ retgen.commands = python $$retgen.script > ${QMAKE_FILE_OUT}
 QMAKE_EXTRA_COMPILERS += retgen
 
 # Taken from WebKit/Tools/qmake/mkspecs/features/unix/default_post.prf
-linux-g++* {
-    greaterThan(QT_GCC_MAJOR_VERSION, 3):greaterThan(QT_GCC_MINOR_VERSION, 5) {
-        !contains(QMAKE_CXXFLAGS, -std=(c|gnu)\\+\\+(0x|11)) {
+!c++11:!intel_icc {
+    # Don't warn about OVERRIDE and FINAL, since they are feature-checked anyways
+    clang {
+        QMAKE_CXXFLAGS += -Wno-c++11-extensions -Wno-c++0x-extensions
+        QMAKE_OBJECTIVE_CFLAGS += -Wno-c++11-extensions -Wno-c++0x-extensions
+    } else: gcc {
+        greaterThan(QT_GCC_MAJOR_VERSION, 4)|greaterThan(QT_GCC_MINOR_VERSION, 5) {
             # We need to deactivate those warnings because some names conflicts with upcoming c++0x types (e.g.nullptr).
             QMAKE_CXXFLAGS_WARN_ON += -Wno-c++0x-compat
             QMAKE_CXXFLAGS += -Wno-c++0x-compat
         }
     }
 }
-
-# Don't warn about OVERRIDE and FINAL, since they are feature-checked anyways
-*clang:!contains(QMAKE_CXXFLAGS, -std=c++11) {
-    QMAKE_CXXFLAGS += -Wno-c++11-extensions
-    QMAKE_OBJECTIVE_CFLAGS += -Wno-c++11-extensions
-}