Add /WX switches for MSVC compilers, except clang-msvc

Clang-msvc has problems with around 400 "-Wexpansion-to-defined" errors
in easylogging++.h. No flags seem to be able to disable this error.
Clang-cl is generally in an awkward halfway place between clang and
msvc.

Msvc has problems with C4127 "conditional expression is constant" in the
"qvarlengtharray.h", hence it being disabled with /wd4127.

Neither msvc* compiler has proper support for disabling errors in
specific files. It's either QMAKE magic or waiting for proper support.
This commit is contained in:
Vasily
2018-12-27 20:09:48 +01:00
parent e8cda901d1
commit f1f39ac1a8
+4 -11
View File
@@ -14,21 +14,14 @@ TARGET = AdvancedSettings
TEMPLATE = app
*msvc* {
#/W4 still has warnings. Including warnings in third party files.
#QMAKE_CFLAGS_WARN_ON -= -W3
#QMAKE_CXXFLAGS_WARN_ON -= -W3
#Removing -W3 from both FLAGS is necessary, otherwise compiler will give
#D9025: overriding '/W4' with '/W3'
#QMAKE_CXXFLAGS += /W4
QMAKE_CFLAGS_WARN_ON -= -W3
QMAKE_CXXFLAGS_WARN_ON -= -W3
QMAKE_CXXFLAGS += /W4 /wd4127
QMAKE_CXXFLAGS += /WX
#The MSVC frontend for clang does not understand /external
!*clang-msvc{
#external:anglebrackets suppresses warnings made in #includes
#made with angle brackets, like #include <iostream>, but will
#still report for includes done with quotes.
QMAKE_CXXFLAGS += /experimental:external /external:anglebrackets
QMAKE_CXXFLAGS += /WX
}
}