diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-09-25 16:00:02 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2020-09-25 18:00:06 (GMT) |
commit | b6418155f35ce997eb9f252f63751d76ff7342bf (patch) | |
tree | 53f5eea3b9ae406ae42c66a16ac2e7a4d757bcfd /Source | |
parent | 0cd1ef0932dfb4c0c2c7d0eaa5d91a8593b3a3d7 (diff) | |
download | CMake-b6418155f35ce997eb9f252f63751d76ff7342bf.zip CMake-b6418155f35ce997eb9f252f63751d76ff7342bf.tar.gz CMake-b6418155f35ce997eb9f252f63751d76ff7342bf.tar.bz2 |
cmGeneratorTarget: Include Cache now occurs per language+config
Previously only occurred per config which broke per-language
system includes.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 7 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 2 |
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; |