summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorLukas Böger <mail@lboeger.de>2021-09-19 16:15:21 (GMT)
committerBrad King <brad.king@kitware.com>2021-09-20 15:15:25 (GMT)
commit2266e223c56be365cadfdf9f394009c095a37c8b (patch)
treed7d3543ce07ffc3efcde31fce18dd5f1d62e2726 /Source/cmGeneratorTarget.cxx
parent96c38493849f05724ec5c2b2e0152c5c86c3b5b0 (diff)
downloadCMake-2266e223c56be365cadfdf9f394009c095a37c8b.zip
CMake-2266e223c56be365cadfdf9f394009c095a37c8b.tar.gz
CMake-2266e223c56be365cadfdf9f394009c095a37c8b.tar.bz2
macOS: Speed up rpath install name dir lookup with a cache
Fixes: #20602
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 4bad7ab..30c022f 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -2170,6 +2170,21 @@ bool cmGeneratorTarget::IsImportedSharedLibWithoutSOName(
bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir(
const std::string& config) const
{
+ TargetPtrToBoolMap& cache = this->MacOSXRpathInstallNameDirCache[config];
+ const auto lookup = cache.find(this->Target);
+
+ if (lookup != cache.cend()) {
+ return lookup->second;
+ }
+
+ const bool result = this->DetermineHasMacOSXRpathInstallNameDir(config);
+ cache[this->Target] = result;
+ return result;
+}
+
+bool cmGeneratorTarget::DetermineHasMacOSXRpathInstallNameDir(
+ const std::string& config) const
+{
bool install_name_is_rpath = false;
bool macosx_rpath = false;