X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fmsvclinker.cpp;fp=source%2Fmsvclinker.cpp;h=49744288fcc1ffaefb4e57a4eec29430646fe741;hb=7c2db9e2b91da953701be233336c5bfa1f3c4af0;hp=46d89f7194a5565692b0a1c032f0d2a206180cc2;hpb=32d6218afe58969f2b18dfa6e262bb9509829abe;p=builder.git diff --git a/source/msvclinker.cpp b/source/msvclinker.cpp index 46d89f7..4974428 100644 --- a/source/msvclinker.cpp +++ b/source/msvclinker.cpp @@ -35,9 +35,9 @@ Target *MsvcLinker::create_target(const list &sources, const string &a throw invalid_argument("MsvcLinker::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("MsvcLinker::create_target"); @@ -80,10 +80,10 @@ void MsvcLinker::do_prepare() system_path.push_back(win_sdk_dir/"lib"/win_sdk_ver/"um"/arch_dir); string path; - for(SearchPath::const_iterator i=system_path.begin(); i!=system_path.end(); ++i) + for(const FS::Path &p: system_path) { - append(path, ";", i->str()); - builder.get_logger().log("tools", format("Got %s system path: %s", tag, *i)); + append(path, ";", p.str()); + builder.get_logger().log("tools", format("Got %s system path: %s", tag, p)); } setenv("LIB", path); @@ -105,8 +105,8 @@ Task *MsvcLinker::run(const Target &target) const BuildInfo binfo; target.collect_build_info(binfo); - /*for(BuildInfo::PathList::const_iterator i=binfo.libpath.begin(); i!=binfo.libpath.end(); ++i) - argv.push_back("/LIBPATH:"+i->str());*/ + /*for(const FS::Path &p: binfo.libpath) + argv.push_back("/LIBPATH:"+p.str());*/ if(binfo.strip) argv.push_back("/INCREMENTAL:NO"); else @@ -114,11 +114,10 @@ Task *MsvcLinker::run(const Target &target) const argv.push_back("/OUT:"+relative(bin.get_path(), work_dir).str()); - const Target::Dependencies &depends = target.get_dependencies(); - for(Target::Dependencies::const_iterator i=depends.begin(); i!=depends.end(); ++i) + for(Target *d: target.get_dependencies()) { - FileTarget *file = dynamic_cast(*i); - Target *tgt = (*i)->get_real_target(); + FileTarget *file = dynamic_cast(d); + Target *tgt = d->get_real_target(); if(ObjectFile *obj = dynamic_cast(tgt)) argv.push_back(relative(obj->get_path(), work_dir).str());