]> git.tdb.fi Git - builder.git/blobdiff - source/mingwdlltool.cpp
Redesign how tools are run
[builder.git] / source / mingwdlltool.cpp
index 922fe51a10b724c5daa0608e55e5efb90e2392fc..62ef7059a885d7a78d2dd216b2d2612c3eeabd42 100644 (file)
@@ -19,6 +19,7 @@ MingwDllTool::MingwDllTool(Builder &b, const Architecture &a):
        Tool(b, a, "DLL")
 {
        set_command("dlltool", true);
+       set_run(_run);
 }
 
 Target *MingwDllTool::create_target(const vector<Target *> &sources, const string &)
@@ -57,8 +58,10 @@ Target *MingwDllTool::create_install(Target &target) const
                return 0;
 }
 
-Task *MingwDllTool::run(const Target &target) const
+Task *MingwDllTool::_run(const Target &target)
 {
+       const Tool &tool = *target.get_tool();
+
        const ImportLibrary *imp = dynamic_cast<const ImportLibrary *>(&target);
        const ExportDefinitions *exp = 0;
        if(imp)
@@ -69,7 +72,7 @@ Task *MingwDllTool::run(const Target &target) const
                throw invalid_argument("MingwDllTool::run");
 
        vector<string> argv;
-       argv.push_back(executable->get_path().str());
+       argv.push_back(tool.get_executable()->get_path().str());
 
        /* dlltool is stupid and puts temporary files in the working directory by
        default */