summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-19 15:32:02 (GMT)
committerBrad King <brad.king@kitware.com>2021-05-19 16:37:16 (GMT)
commitae927f936d6bfc6c5004fc6c47994f481b9d6796 (patch)
treecf541ec1b0b3610a33c6d2b460d026fb6c6c1526 /Source/cmGlobalNinjaGenerator.cxx
parent68e5f92cada35068f71a8c46388aeb4eb1383bca (diff)
downloadCMake-ae927f936d6bfc6c5004fc6c47994f481b9d6796.zip
CMake-ae927f936d6bfc6c5004fc6c47994f481b9d6796.tar.gz
CMake-ae927f936d6bfc6c5004fc6c47994f481b9d6796.tar.bz2
cmGlobalNinjaGenerator: Improve allocation pattern in WriteBuild
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 64aaf48..a0baf3f 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -216,25 +216,24 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
{
// Write explicit outputs
for (std::string const& output : build.Outputs) {
- buildStr += cmStrCat(' ', this->EncodePath(output));
+ buildStr = cmStrCat(buildStr, ' ', this->EncodePath(output));
if (this->ComputingUnknownDependencies) {
this->CombinedBuildOutputs.insert(output);
}
}
// Write implicit outputs
if (!build.ImplicitOuts.empty()) {
- buildStr += " |";
+ buildStr = cmStrCat(buildStr, " |");
for (std::string const& implicitOut : build.ImplicitOuts) {
- buildStr += cmStrCat(' ', this->EncodePath(implicitOut));
+ buildStr = cmStrCat(buildStr, ' ', this->EncodePath(implicitOut));
if (this->ComputingUnknownDependencies) {
this->CombinedBuildOutputs.insert(implicitOut);
}
}
}
- buildStr += ':';
// Write the rule.
- buildStr += cmStrCat(' ', build.Rule);
+ buildStr = cmStrCat(buildStr, ": ", build.Rule);
}
std::string arguments;