Separate branches for gcc and clang flags

This commit is contained in:
Phil Olynyk 2022-04-13 11:59:04 -04:00
parent cc8d38f3b0
commit 8c9d3362c5

View File

@ -521,6 +521,7 @@ DISTFILES += help/default.css \
help/index.qhcp
}
message("CXXFLAGS pre-mods $$QMAKE_CXXFLAGS ")
# Always treat warnings as errors, even (especially!) in release
QMAKE_CFLAGS += -Werror
@ -533,22 +534,28 @@ gcc | clang {
COMPILER_MAJOR = $$first(COMPILER_MAJOR)
message("$$QMAKE_CXX major version $$COMPILER_MAJOR")
## equals($$QMAKE_CXX, "gcc") : { // guwess what! the name is really "g++"
gcc {
greaterThan(COMPILER_MAJOR, 10) : {
QMAKE_CFLAGS += -Wno-error=stringop-overread
QMAKE_CXXFLAGS += -Wno-error=stringop-overread
message("Removing stringop-overread error")
}
}
}
## equals($$QMAKE_CXX, "gcc") : { // guess what! the name is really "g++"
gcc {
message("Detected compiler type gcc")
greaterThan(COMPILER_MAJOR, 10) : {
QMAKE_CFLAGS += -Wno-error=stringop-overread
QMAKE_CXXFLAGS += -Wno-error=stringop-overread
message("Making stringop-overread a non-error")
}
}
clang {
message("Detected comiler type clang")
}
# Make deprecation warnings just warnings
QMAKE_CFLAGS += -Wno-error=deprecated-declarations
QMAKE_CXXFLAGS += -Wno-error=deprecated-declarations
message("CXXFLAGS post-mods $$QMAKE_CXXFLAGS ")
lessThan(QT_MAJOR_VERSION,5)|lessThan(QT_MINOR_VERSION,9) {
QMAKE_CFLAGS += -Wno-error=strict-aliasing
QMAKE_CXXFLAGS += -Wno-error=strict-aliasing