summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-20 16:54:44 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-20 16:55:04 (GMT)
commit56a3e84a67bebd645914a65eea825aab365f88c7 (patch)
tree6769c97af9ca458f89932fc58e935eef15103bd6 /Source/cmGlobalGenerator.cxx
parenta44b83c138828039ff85443b4a3e631d79ce7e5b (diff)
parent9d5a554cc9de0ac03d2da7dc95b8ef1db4a526e9 (diff)
downloadCMake-56a3e84a67bebd645914a65eea825aab365f88c7.zip
CMake-56a3e84a67bebd645914a65eea825aab365f88c7.tar.gz
CMake-56a3e84a67bebd645914a65eea825aab365f88c7.tar.bz2
Merge topic 'realpath-cache'
9d5a554cc9 cmGlobalGenerator: Add cache for realpath() results Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4220
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index b3eb8e4..38ff3ae 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -7,6 +7,7 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
+#include <functional>
#include <initializer_list>
#include <iterator>
#include <sstream>
@@ -3120,6 +3121,16 @@ cmGlobalGenerator::GetFilenameTargetDepends(cmSourceFile* sf) const
return this->FilenameTargetDepends[sf];
}
+const std::string& cmGlobalGenerator::GetRealPath(const std::string& dir)
+{
+ auto i = this->RealPaths.lower_bound(dir);
+ if (i == this->RealPaths.end() ||
+ this->RealPaths.key_comp()(dir, i->first)) {
+ i = this->RealPaths.emplace_hint(i, dir, cmSystemTools::GetRealPath(dir));
+ }
+ return i->second;
+}
+
void cmGlobalGenerator::ProcessEvaluationFiles()
{
std::vector<std::string> generatedFiles;