aboutsummaryrefslogtreecommitdiff
path: root/backend/ninja
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-12-31 09:36:54 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:58 +0200
commit7cc5348a8b7495b8b79ed1830223bd3acd3c8aee (patch)
tree705ee9f078712245c34e3a5232b58b637870085c /backend/ninja
parentaf6ab529bead084b32057053b88606ca69f5db3f (diff)
Add error_on_warning option to allow turning compiler warnings to errors
Diffstat (limited to 'backend/ninja')
-rw-r--r--backend/ninja/Ninja.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index e05b7b9..69b480e 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -1013,6 +1013,11 @@ namespace backend
compileCCommand.push_back(ninja::NinjaArg("-w"));
}
+ if(config.errorOnWarning)
+ {
+ compileCCommand.push_back(ninja::NinjaArg("-Werror"));
+ }
+
vector<ninja::NinjaArg> optimizationFlags = getCompilerOptimizationFlags(config);
compileCCommand.insert(compileCCommand.end(), optimizationFlags.begin(), optimizationFlags.end());
@@ -1049,6 +1054,9 @@ namespace backend
else
compileCCommand.push_back(ninja::NinjaArg("/w"));
+ if(config.errorOnWarning)
+ compileCCommand.push_back(ninja::NinjaArg("/WX"));
+
// TODO: Remove this once locate_windows_sdk has been updated to locate multiple arch windows sdk
#if OS_TYPE == OS_TYPE_WINDOWS && defined(SIBS_ENV_32BIT)
#error "sibs is currently not supported on windows 32-bit because locate_windows_sdk can only locate x64 windows sdk"