using namespace std;
using namespace Msp;
-BinaryComponent::BinaryComponent(SourcePackage &p, const string &n, Type t):
- Component(p, n),
- type(t)
-{ }
-
void BinaryComponent::create_build_info()
{
Component::create_build_info();
const Toolchain &toolchain = builder.get_toolchain();
const Toolchain &pkg_tools = package.get_toolchain();
- list<Target *> objs;
- list<FS::Path> source_filenames = collect_source_files();
+ vector<Target *> objs;
+ vector<FS::Path> source_filenames = collect_source_files();
+ objs.reserve(source_filenames.size());
for(auto i=source_filenames.begin(); i!=source_filenames.end(); ++i)
{
string ext = FS::extpart(FS::basename(*i));
Tool *gen = pkg_tools.get_tool_for_suffix(ext);
if(gen)
{
- list<Target *> templates;
+ vector<Target *> templates;
templates.push_back(gen->create_source(*this, *i));
Tool::ProcessingUnit processing_unit = gen->get_processing_unit();
if(processing_unit!=Tool::ONE_FILE)
{
FS::Path source_dir = FS::dirname(*i);
- auto j = i;
- for(++j; j!=source_filenames.end(); )
+ for(auto j=next(i); j!=source_filenames.end(); )
{
if((processing_unit!=Tool::DIRECTORY || FS::dirname(*j)==source_dir) &&
pkg_tools.get_tool_for_suffix(FS::extpart(FS::basename(*j)))==gen)
{
templates.push_back(gen->create_source(*this, *j));
// Remove additional files so they won't get processed again
- source_filenames.erase(j++);
+ j = source_filenames.erase(j);
}
else
++j;
Tool &linker = toolchain.get_tool("LINK");
- list<Target *> results;
+ vector<Target *> results;
+ results.reserve(2);
if(type==LIBRARY)
{
Tool &archiver = toolchain.get_tool("AR");