X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmingwdlltool.cpp;h=dc9022e12378c06b56016fbb00e12a0596beb3b1;hb=1ec533a7777be4dce9c8b6bbb1cbc32d38098ae4;hp=1bb35093620aac6edfda6f85dd149514bdd91596;hpb=7ed7c30ee0ceb734f17fe0c6d4bc6d37fb2ab5a7;p=builder.git diff --git a/source/mingwdlltool.cpp b/source/mingwdlltool.cpp index 1bb3509..dc9022e 100644 --- a/source/mingwdlltool.cpp +++ b/source/mingwdlltool.cpp @@ -17,7 +17,9 @@ using namespace Msp; MingwDllTool::MingwDllTool(Builder &b, const Architecture &a): Tool(b, a, "DLL") -{ } +{ + set_command("dlltool", true); +} Target *MingwDllTool::create_target(const list &sources, const string &) { @@ -26,9 +28,8 @@ Target *MingwDllTool::create_target(const list &sources, const string SharedLibrary &shlib = dynamic_cast(*sources.front()); list objs; - const Target::Dependencies &depends = shlib.get_dependencies(); - for(Target::Dependencies::const_iterator i=depends.begin(); i!=depends.end(); ++i) - if(ObjectFile *obj = dynamic_cast(*i)) + for(Target *d: shlib.get_dependencies()) + if(ObjectFile *obj = dynamic_cast(d)) objs.push_back(obj); ExportDefinitions *exp = new ExportDefinitions(builder, *shlib.get_component(), objs); @@ -55,11 +56,6 @@ Target *MingwDllTool::create_install(Target &target) const return 0; } -void MingwDllTool::do_prepare() -{ - set_executable("dlltool", true); -} - Task *MingwDllTool::run(const Target &target) const { const ImportLibrary *imp = dynamic_cast(&target); @@ -103,12 +99,9 @@ Task *MingwDllTool::run(const Target &target) const } else { - const Target::Dependencies &depends = exp->get_dependencies(); - for(Target::Dependencies::const_iterator i=depends.begin(); i!=depends.end(); ++i) - { - if(ObjectFile *obj = dynamic_cast(*i)) + for(Target *d: exp->get_dependencies()) + if(ObjectFile *obj = dynamic_cast(d)) argv.push_back(relative(obj->get_path(), work_dir).str()); - } // XXX Should use dllexport, but that has some other problems to solve argv.push_back("--export-all-symbols");