diff --git a/common.pri b/common.pri index ecdd0c863..f59d464f3 100644 --- a/common.pri +++ b/common.pri @@ -16,8 +16,9 @@ win32{ unix{ *g++* { GCC_VERSION = $$system("g++ -dumpfullversion -dumpversion") - message("g++ version $$GCC_VERSION found") - COMPILER_MAJOR_VERSION = $$str_member($${GCC_VERSION}) + GCC_VERSIONS = $$split(GCC_VERSION, ".") + COMPILER_MAJOR_VERSION = $$member(GCC_VERSIONS, 0) + message("g++ version $${COMPILER_MAJOR_VERSION}.x found") greaterThan(COMPILER_MAJOR_VERSION, 3):CONFIG += g++4 greaterThan(COMPILER_MAJOR_VERSION, 4):CONFIG += g++5 @@ -416,16 +417,12 @@ g++6:GCC_DEBUG_CXXFLAGS += \ -Wmisleading-indentation # Since GCC 7 -g++7{ - GCC_DEBUG_CXXFLAGS += \ - -Wduplicated-branches \ - -Wrestrict \ - -Walloc-zero \ - -Wnonnull \ - -Wno-stringop-overflow # cannot suppress warning in Qt headers - - QMAKE_CXXFLAGS_WARN_ON += -Wno-stringop-overflow # cannot suppress warning in Qt headers -} +g++7:GCC_DEBUG_CXXFLAGS += \ + -Wduplicated-branches \ + -Wrestrict \ + -Walloc-zero \ + -Wnonnull \ + -Wno-stringop-overflow # cannot suppress warning in Qt headers # Since GCC 8 g++8:GCC_DEBUG_CXXFLAGS += \