diff options
author | Brad King <brad.king@kitware.com> | 2021-05-19 15:32:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-05-19 16:37:16 (GMT) |
commit | ae927f936d6bfc6c5004fc6c47994f481b9d6796 (patch) | |
tree | cf541ec1b0b3610a33c6d2b460d026fb6c6c1526 /Source/cmGlobalNinjaGenerator.cxx | |
parent | 68e5f92cada35068f71a8c46388aeb4eb1383bca (diff) | |
download | CMake-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.cxx | 9 |
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; |