summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-10-20 02:11:33 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-10-20 03:09:33 (GMT)
commit51f9d9f0a2a85744e9214aaa24054fabb9e79355 (patch)
treeca7e17167262d7598f48fdbb66a3ebf083d596f2 /Source/cmNinjaTargetGenerator.cxx
parentdec211da56e19d07503b4a4e8002dc76359dc588 (diff)
downloadCMake-51f9d9f0a2a85744e9214aaa24054fabb9e79355.zip
CMake-51f9d9f0a2a85744e9214aaa24054fabb9e79355.tar.gz
CMake-51f9d9f0a2a85744e9214aaa24054fabb9e79355.tar.bz2
cmNinjaTargetGenerator: avoid traversing old outputs repeatedly
We actually only need to look at outputs just added to the vector, not all outputs that have been detected so far.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 0bda945..af47158 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1048,10 +1048,13 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
cmCustomCommandGenerator ccg(*cc, config, this->GetLocalGenerator());
const std::vector<std::string>& ccoutputs = ccg.GetOutputs();
const std::vector<std::string>& ccbyproducts = ccg.GetByproducts();
+ auto const nPreviousOutputs = ccouts.size();
ccouts.insert(ccouts.end(), ccoutputs.begin(), ccoutputs.end());
ccouts.insert(ccouts.end(), ccbyproducts.begin(), ccbyproducts.end());
if (usePrivateGeneratedSources) {
auto it = ccouts.begin();
+ // Skip over outputs that were already detected.
+ std::advance(it, nPreviousOutputs);
while (it != ccouts.end()) {
cmFileSet const* fileset =
this->GeneratorTarget->GetFileSetForSource(