aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
parentaf6ab529bead084b32057053b88606ca69f5db3f (diff)
Add error_on_warning option to allow turning compiler warnings to errors
Diffstat (limited to 'src')
-rw-r--r--src/Conf.cpp18
1 files changed, 18 insertions, 0 deletions
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);
}