X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgnuarchiver.cpp;h=742278de668653f17895abab2e6d003fc9698e16;hb=bc6d4c540e7132c829dd558ca9d8acfbde7d71e1;hp=6cf4adb90f80c0df53ff686e5da0e42d04c0ae31;hpb=e516e78510ad455eebc0e06645c9f12943117525;p=builder.git diff --git a/source/gnuarchiver.cpp b/source/gnuarchiver.cpp index 6cf4adb..742278d 100644 --- a/source/gnuarchiver.cpp +++ b/source/gnuarchiver.cpp @@ -18,6 +18,7 @@ GnuArchiver::GnuArchiver(Builder &b, const Architecture &a): { set_command("ar", true); input_suffixes.push_back(".o"); + processing_unit = COMPONENT; } Target *GnuArchiver::create_target(const list &sources, const string &) @@ -26,9 +27,9 @@ Target *GnuArchiver::create_target(const list &sources, const string & throw invalid_argument("GnuArchiver::create_target"); list objs; - for(list::const_iterator i=sources.begin(); i!=sources.end(); ++i) + for(Target *s: sources) { - if(ObjectFile *obj = dynamic_cast(*i)) + if(ObjectFile *obj = dynamic_cast(s)) objs.push_back(obj); else throw invalid_argument("GnuArchiver::create_target"); @@ -53,9 +54,8 @@ Task *GnuArchiver::run(const Target &target) const argv.push_back(relative(lib.get_path(), work_dir).str()); - const Target::Dependencies &deps = lib.get_dependencies(); - for(Target::Dependencies::const_iterator i=deps.begin(); i!=deps.end(); ++i) - if(ObjectFile *obj = dynamic_cast(*i)) + for(Target *d: lib.get_dependencies()) + if(ObjectFile *obj = dynamic_cast(d)) argv.push_back(relative(obj->get_path(), work_dir).str()); return new ExternalTask(argv, work_dir);