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.
This commit is contained in:
parent
6820882be5
commit
870bd16f2c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue