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 --- src/Conf.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/Conf.cpp b/src/Conf.cpp index 1962517..e3c894a 100644 --- a/src/Conf.cpp +++ b/src/Conf.cpp @@ -1067,6 +1067,24 @@ namespace sibs else throw ParserException("Expected " + string(currentObject.data, currentObject.size) + ".ignore_dirs to be a list, was a single value"); } + else if(name.equals("error_on_warning")) + { + if (value.isSingle()) + { + StringView value_str = value.asSingle(); + bool value_bool = false; + if(value_str.equals("true")) + value_bool = true; + else if(value_str.equals("false")) + value_bool = false; + else + throw ParserException("Expected " + string(currentObject.data, currentObject.size) + ".error_on_warning to be either true or false"); + + errorOnWarning = value_bool; + } + else + throw ParserException("Expected " + string(currentObject.data, currentObject.size) + ".error_on_warning to be a single value, was a list"); + } else failInvalidFieldUnderObject(name); } -- cgit v1.2.3