summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorPierre Testart <ptestart@soundhound.com>2022-12-19 17:00:17 (GMT)
committerBrad King <brad.king@kitware.com>2023-01-18 14:12:17 (GMT)
commita525f5f1bfc79ece662df6453cf49e25d0259eb0 (patch)
tree03971f3a712836b9c5fcf00568b471381f37b7f0 /Source/cmGlobalXCodeGenerator.cxx
parenta212c7734a966308fdf7a1a04b40e2198e35115c (diff)
downloadCMake-a525f5f1bfc79ece662df6453cf49e25d0259eb0.zip
CMake-a525f5f1bfc79ece662df6453cf49e25d0259eb0.tar.gz
CMake-a525f5f1bfc79ece662df6453cf49e25d0259eb0.tar.bz2
cmGeneratorTarget: Cache full name components
Cache the result of cmGeneratorTarget::GetFullNameInternalComponents to improve performance.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f19dfd5..5f28fc6 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2516,10 +2516,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
}
// Get the product name components.
- std::string pnprefix;
- std::string pnbase;
- std::string pnsuffix;
- gtgt->GetFullNameComponents(pnprefix, pnbase, pnsuffix, configName);
+ cmGeneratorTarget::NameComponents const& components =
+ gtgt->GetFullNameComponents(configName);
cmValue version = gtgt->GetProperty("VERSION");
cmValue soversion = gtgt->GetProperty("SOVERSION");
@@ -2534,8 +2532,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
version = soversion;
}
- std::string realName = pnbase;
- std::string soName = pnbase;
+ std::string realName = components.base;
+ std::string soName = components.base;
if (version && soversion) {
realName += ".";
realName += *version;
@@ -2565,15 +2563,15 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
gtgt->GetType() == cmStateEnums::SHARED_LIBRARY ||
gtgt->GetType() == cmStateEnums::MODULE_LIBRARY ||
gtgt->GetType() == cmStateEnums::EXECUTABLE) {
-
+ std::string prefix = components.prefix;
if (gtgt->IsFrameworkOnApple() || gtgt->IsCFBundleOnApple()) {
- pnprefix = "";
+ prefix = "";
}
buildSettings->AddAttribute("EXECUTABLE_PREFIX",
- this->CreateString(pnprefix));
+ this->CreateString(prefix));
buildSettings->AddAttribute("EXECUTABLE_SUFFIX",
- this->CreateString(pnsuffix));
+ this->CreateString(components.suffix));
}
// Store the product name for all target types.