From 7cc5348a8b7495b8b79ed1830223bd3acd3c8aee Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 31 Dec 2019 09:36:54 +0100 Subject: Add error_on_warning option to allow turning compiler warnings to errors --- backend/ninja/Ninja.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'backend/ninja/Ninja.cpp') 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 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" -- cgit v1.2.3