From 087d2426646325569ad0965ac43ba9b8ddc11449 Mon Sep 17 00:00:00 2001 From: Vasily Date: Thu, 27 Dec 2018 00:53:47 +0100 Subject: [PATCH] Add compiler switches for warnings as errors Currently with /W3 on MSVC there are no warnings. Clang and g++ are not tested. The "QMAKE_CFLAGS_WARN_ON -= -W3" and "QMAKE_CXXFLAGS_WARN_ON -= -W3" are necessary because if they are not removed in the config, the compiler will give D9025: overriding '/W4' with '/W3' error warnings and not actually use /W4. --- advancedSettings.pro | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/advancedSettings.pro b/advancedSettings.pro index 03159dc..1d180ff 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -13,7 +13,24 @@ lessThan(QT_MINOR_VERSION, 6): error("requires Qt 5.6 or higher") 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_CXXFLAGS += /WX +} +*g++* { + QMAKE_CXXFLAGS += -Werror +} + +*clang* { + QMAKE_CXXFLAGS += -Werror +} SOURCES += src/main.cpp\ src/overlaycontroller.cpp \ src/tabcontrollers/AudioTabController.cpp \