From f1f39ac1a81e6c2724d5dfa3e97a8c89c2e5f64f Mon Sep 17 00:00:00 2001 From: Vasily Date: Thu, 27 Dec 2018 20:09:48 +0100 Subject: [PATCH] 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. --- advancedSettings.pro | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/advancedSettings.pro b/advancedSettings.pro index 497199d..9458a0f 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -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 , but will - #still report for includes done with quotes. - QMAKE_CXXFLAGS += /experimental:external /external:anglebrackets + QMAKE_CXXFLAGS += /WX } }