Commit 870bd16f authored by Stephen Kelly's avatar Stephen Kelly

QtAutogen: Don't modify target source files while iterating them.

Populate a separate vector of files and append them separately. This
was the pattern used prior to commit 035b6908 (Autogen: Split AutoRcc
handling into two methods, 2013-12-10), which was erroneously not
maintained in that refactoring.
parent 6820882b
......@@ -810,6 +810,8 @@ void cmQtAutoGenerators::InitializeAutoRccTarget(cmTarget* target)
const std::vector<cmSourceFile*>& srcFiles = target->GetSourceFiles();
std::vector<cmSourceFile*> newFiles;
for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
fileIt != srcFiles.end();
++fileIt)
......@@ -833,10 +835,17 @@ void cmQtAutoGenerators::InitializeAutoRccTarget(cmTarget* target)
rcc_output_file.c_str(), false);
cmSourceFile* rccCppSource
= makefile->GetOrCreateSource(rcc_output_file.c_str(), true);
target->AddSourceFile(rccCppSource);
newFiles.push_back(rccCppSource);
}
}
}
for(std::vector<cmSourceFile*>::const_iterator fileIt = newFiles.begin();
fileIt != newFiles.end();
++fileIt)
{
target->AddSourceFile(*fileIt);
}
}
void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment