list<Target *> dep_libs;
set<string> missing_libs;
queue.push_back(this);
- while(!queue.empty())
+ for(list<Target *>::iterator j=queue.begin(); j!=queue.end(); ++j)
{
- Target *tgt = queue.front();
- queue.pop_front();
+ Target *tgt = *j;
BuildInfo binfo;
tgt->collect_build_info(binfo);
if(tgt!=this)
static_binfo.libpath.insert(static_binfo.libpath.end(), binfo.libpath.begin(), binfo.libpath.end());
+ list<Target *>::iterator insert_pos = j;
+ ++insert_pos;
for(BuildInfo::WordList::const_iterator i=binfo.libs.begin(); i!=binfo.libs.end(); ++i)
{
if(i->size()>10 && !i->compare(i->size()-10, 10, ".framework"))
{
Target *real = lib->get_real_target();
if(StaticLibrary *stlib = dynamic_cast<StaticLibrary *>(real))
- {
- dep_libs.push_back(stlib);
- queue.push_back(stlib);
- }
+ queue.insert(insert_pos, stlib);
else
dep_libs.push_back(lib);
}
}
}
+ queue.pop_front();
+ dep_libs.splice(dep_libs.begin(), queue);
+
/* Add only the last occurrence of each library to the actual dependencies.
This ensures that static library ordering is correct. */
for(list<Target *>::iterator i=dep_libs.begin(); i!=dep_libs.end(); ++i)