From ab712cf153e543e84a5c6484e19d22ba90bdbeff Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 31 Dec 2017 06:17:54 +0100 Subject: 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. --- src/Conf.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/Conf.cpp') 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 &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)) { -- cgit v1.2.3