return create_target(sources, arg);
}
-void Tool::prepare(Tool *tool)
+void Tool::prepare()
{
- if(!tool)
- tool = this;
- else if(tool->get_base_tool()!=this)
- throw invalid_argument("Tool::prepare");
-
- if(tool->prepared)
+ if(prepared)
return;
- tool->prepared = true;
- if(!tool->command.empty())
- tool->executable = builder.get_vfs().find_binary(tool->command);
- do_prepare(*tool);
+ prepared = true;
+
+ if(!command.empty())
+ executable = builder.get_vfs().find_binary(command);
+ prepare(*this);
if(!command.empty() && !executable)
{
- 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));
+ builder.get_logger().log("problems", "Can't find executable %s for %s", command, tag);
+ problems.push_back(format("Can't find executable %s", command));
}
}
+void Tool::prepare(Tool &tool) const
+{
+ if(&tool!=this && tool.get_base_tool()!=this)
+ throw invalid_argument("Tool::prepare");
+
+ do_prepare(tool);
+}
+
string Tool::create_build_signature(const BuildInfo &) const
{
if(executable)
virtual std::string create_build_signature(const BuildInfo &) const;
- void prepare(Tool * = 0);
+ void prepare();
+ void prepare(Tool &) const;
protected:
virtual void do_prepare(ToolData &) const { }