X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftool.cpp;h=d7b27ff275e39cfbdd908ffbc21119474a40d540;hb=68ef01e3f94ba5d0297e7979551e7d9404906db7;hp=cd002379ccc110c3cc13569563695077bea48b79;hpb=c8c51fac9453a677fc3e6932c4730f35e237af89;p=builder.git diff --git a/source/tool.cpp b/source/tool.cpp index cd00237..d7b27ff 100644 --- a/source/tool.cpp +++ b/source/tool.cpp @@ -37,19 +37,24 @@ Target *Tool::create_target(Target &source, const string &arg) 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)); } }