cmGeneratorTarget: Cache full name components

Cache the result of cmGeneratorTarget::GetFullNameInternalComponents
to improve performance.
This commit is contained in:
Pierre Testart
2022-12-19 18:00:17 +01:00
committed by Brad King
parent a212c7734a
commit a525f5f1bf
5 changed files with 95 additions and 92 deletions

View File

@@ -1228,16 +1228,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
if (!this->SetMsvcTargetPdbVariable(vars, config)) {
// It is common to place debug symbols at a specific place,
// so we need a plain target name in the rule available.
std::string prefix;
std::string base;
std::string suffix;
gt->GetFullNameComponents(prefix, base, suffix, config);
cmGeneratorTarget::NameComponents const& components =
gt->GetFullNameComponents(config);
std::string dbg_suffix = ".dbg";
// TODO: Where to document?
if (cmValue d = mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) {
dbg_suffix = *d;
}
vars["TARGET_PDB"] = base + suffix + dbg_suffix;
vars["TARGET_PDB"] = components.base + components.suffix + dbg_suffix;
}
const std::string objPath =