aboutsummaryrefslogtreecommitdiff
path: root/src/Conf.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2017-12-31 06:17:54 +0100
committerdec05eba <dec05eba@protonmail.com>2017-12-31 06:19:50 +0100
commitab712cf153e543e84a5c6484e19d22ba90bdbeff (patch)
treeb82b101b586deb6caca63a1de8737a89e82bd4f5 /src/Conf.cpp
parentae213b2b6f8dcc75de53ab27b0b35bc3455a8eb3 (diff)
Add cmake building, add ignore dirs option
Sometimes it's not possible to build new sibs with older sibs because of changes that break backwards compatbility. If sibs installation fails with sibs, use cmake.
Diffstat (limited to 'src/Conf.cpp')
-rw-r--r--src/Conf.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp
index 4217846..032d89f 100644
--- a/src/Conf.cpp
+++ b/src/Conf.cpp
@@ -383,6 +383,17 @@ namespace sibs
}
}
+ bool directoryToIgnore(const FileString &dir, const vector<string> &ignoreDirList)
+ {
+ string dirUtf8 = toUtf8(dir);
+ for(const string &ignoreDir : ignoreDirList)
+ {
+ if(pathEquals(dirUtf8, ignoreDir))
+ return true;
+ }
+ return false;
+ }
+
bool SibsConfig::isDefined(const std::string &name) const
{
return defines.find(name) != defines.end();
@@ -574,6 +585,26 @@ namespace sibs
else
throw ParserException("Expected package.platforms to be a list, was a single value");
}
+ else if(name.equals("ignore_dirs"))
+ {
+ if (value.isList())
+ {
+ string projectPathUtf8 = toUtf8(projectPath);
+ // TODO: Checking for duplicate declaration should be done in the config parser
+ if (!ignoreDirs.empty())
+ throw ParserException("Found duplicate declaration of package.ignore_dirs");
+
+ for (const StringView &ignoreDir : value.asList())
+ {
+ string ignoreDirFull = projectPathUtf8;
+ ignoreDirFull += "/";
+ ignoreDirFull += string(ignoreDir.data, ignoreDir.size);
+ ignoreDirs.emplace_back(ignoreDirFull);
+ }
+ }
+ else
+ throw ParserException("Expected package.ignore_dirs to be a list, was a single value");
+ }
}
else if (currentObject.equals(CONFIG_SYSTEM_PLATFORM))
{