qmake function str_member incorrectly parsed GCC version.

GCC 11 returned as GCC 1.
This commit is contained in:
Roman Telezhynskyi 2021-09-25 20:12:15 +03:00
parent d1e6eb269d
commit a4c484f821

View File

@ -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 += \