Tool(b, a, "DLL")
{
set_command("dlltool", true);
+ set_run(_run);
}
-Target *MingwDllTool::create_target(const list<Target *> &sources, const string &)
+Target *MingwDllTool::create_target(const vector<Target *> &sources, const string &)
{
if(sources.size()!=1)
throw invalid_argument("MingwDllTool::create_target");
SharedLibrary &shlib = dynamic_cast<SharedLibrary &>(*sources.front());
- list<ObjectFile *> objs;
+ vector<ObjectFile *> objs;
+ objs.reserve(shlib.get_dependencies().size());
for(Target *d: shlib.get_dependencies())
if(ObjectFile *obj = dynamic_cast<ObjectFile *>(d))
objs.push_back(obj);
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)
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 */