diff options
Diffstat (limited to 'src/Conf.cpp')
-rw-r--r-- | src/Conf.cpp | 31 |
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)) { |