return create_target(sources, arg);
}
-void Tool::prepare()
+void Tool::prepare(Tool *tool)
{
- if(prepared)
+ if(!tool)
+ tool = this;
+ else if(tool->get_base_tool()!=this)
+ throw invalid_argument("Tool::prepare");
+
+ if(tool->prepared)
return;
- prepared = true;
- if(!command.empty())
- executable = builder.get_vfs().find_binary(command);
- do_prepare();
+ tool->prepared = true;
+ if(!tool->command.empty())
+ tool->executable = builder.get_vfs().find_binary(tool->command);
+ do_prepare(*tool);
if(!command.empty() && !executable)
{
- builder.get_logger().log("problems", "Can't find executable %s for %s", command, tag);
- problems.push_back(format("Can't find executable %s", command));
+ builder.get_logger().log("problems", "Can't find executable %s for %s", tool->command, tool->tag);
+ tool->problems.push_back(format("Can't find executable %s", tool->command));
}
}