aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Conf.cpp40
-rw-r--r--src/main.cpp6
2 files changed, 43 insertions, 3 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp
index 543c8d9..c2302e4 100644
--- a/src/Conf.cpp
+++ b/src/Conf.cpp
@@ -1125,9 +1125,13 @@ namespace sibs
{
cVersion = CVersion::C11;
}
+ else if(cVersionStr.equals("c20"))
+ {
+ cVersion = CVersion::C20;
+ }
else
{
- string errMsg = "Expected lang.c.version to be ansi, c89, c99 or c11, was ";
+ string errMsg = "Expected lang.c.version to be ansi, c89, c99, c11, c20, was ";
errMsg += string(cVersionStr.data, cVersionStr.size);
throw ParserException(errMsg);
}
@@ -1147,7 +1151,15 @@ namespace sibs
if(fieldValue.isSingle())
{
const StringView &cppVersionStr = fieldValue.asSingle();
- if(cppVersionStr.equals("c++11"))
+ if(cppVersionStr.equals("c++03"))
+ {
+ cppVersion = CPPVersion::CPP03;
+ }
+ else if(cppVersionStr.equals("c++98"))
+ {
+ cppVersion = CPPVersion::CPP98;
+ }
+ else if(cppVersionStr.equals("c++11"))
{
cppVersion = CPPVersion::CPP11;
}
@@ -1159,9 +1171,13 @@ namespace sibs
{
cppVersion = CPPVersion::CPP17;
}
+ else if(cppVersionStr.equals("c++20"))
+ {
+ cppVersion = CPPVersion::CPP20;
+ }
else
{
- string errMsg = "Expected lang.cpp.version to be c++11, c++14 or c++17, was ";
+ string errMsg = "Expected lang.cpp.version to be c++03, c++98, c++11, c++14, c++17 or c++20, was ";
errMsg += string(cppVersionStr.data, cppVersionStr.size);
throw ParserException(errMsg);
}
@@ -1169,6 +1185,24 @@ namespace sibs
else
throw ParserException("Expected lang.cpp.version to be a single value, was a list");
}
+ else if(fieldName.equals("enable_exceptions"))
+ {
+ if (fieldValue.isSingle())
+ {
+ StringView value_str = fieldValue.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) + ".enable_exceptions to be either true or false");
+
+ enableExceptions = value_bool;
+ }
+ else
+ throw ParserException("Expected " + string(currentObject.data, currentObject.size) + ".enable_exceptions to be a single value, was a list");
+ }
else
failInvalidFieldUnderObject(fieldName);
}
diff --git a/src/main.cpp b/src/main.cpp
index 5c3ad8c..00b7e92 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -368,6 +368,12 @@ static int buildProject(const FileString &projectPath, const FileString &project
{
FileString buildPath;
readSibsConfig(projectPath, projectConfFilePath, sibsConfig, buildPath);
+
+ if(run && sibsConfig.getPackageType() != PackageType::EXECUTABLE) {
+ ferr << "Error: sibs run can only be used with executable projects" << endl;
+ exit(7);
+ }
+
// Test project has the main project as dependency, and therefore the main project can't be built as an executable
if(sibsConfig.shouldBuildTests())
{