summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-29 09:48:05 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-29 09:48:11 (GMT)
commita456dd6c26ba677035a9729b7bf1470bc0b68e49 (patch)
tree16eea46d5eec2aaa03d369196c9b5e9cadb82cd3 /Source
parent0021d24fb3fa8ca6ec16f5b6f44952cc375d499f (diff)
parentb6418155f35ce997eb9f252f63751d76ff7342bf (diff)
downloadCMake-a456dd6c26ba677035a9729b7bf1470bc0b68e49.zip
CMake-a456dd6c26ba677035a9729b7bf1470bc0b68e49.tar.gz
CMake-a456dd6c26ba677035a9729b7bf1470bc0b68e49.tar.bz2
Merge topic 'system_include_dir_caching_pre_lang'
b6418155f3 cmGeneratorTarget: Include Cache now occurs per language+config Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5274
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx7
-rw-r--r--Source/cmGeneratorTarget.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 8589ab1..ed36838 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1195,8 +1195,8 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(
config_upper = cmSystemTools::UpperCase(config);
}
- using IncludeCacheType = std::map<std::string, std::vector<std::string>>;
- auto iter = this->SystemIncludesCache.find(config_upper);
+ std::string key = cmStrCat(config_upper, "/", language);
+ auto iter = this->SystemIncludesCache.find(key);
if (iter == this->SystemIncludesCache.end()) {
cmGeneratorExpressionDAGChecker dagChecker(
@@ -1224,8 +1224,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(
std::sort(result.begin(), result.end());
result.erase(std::unique(result.begin(), result.end()), result.end());
- IncludeCacheType::value_type entry(config_upper, result);
- iter = this->SystemIncludesCache.insert(entry).first;
+ iter = this->SystemIncludesCache.emplace(key, result).first;
}
return std::binary_search(iter->second.begin(), iter->second.end(), dir);
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 8e0def7..2390b03 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -849,6 +849,8 @@ private:
mutable std::set<std::string> VisitedConfigsForObjects;
mutable std::map<cmSourceFile const*, std::string> Objects;
std::set<cmSourceFile const*> ExplicitObjectName;
+
+ // "config/language" is the key
mutable std::map<std::string, std::vector<std::string>> SystemIncludesCache;
mutable std::string ExportMacro;