2 #include <msp/strings/format.h>
3 #include "architecture.h"
10 Tool::Tool(Builder &b, const string &t):
18 Tool::Tool(Builder &b, const Architecture &a, const string &t):
26 void Tool::set_command(const string &cmd, bool cross)
29 throw invalid_argument("Tool::set_command");
31 if(cross && architecture->is_cross())
32 command = format("%s-%s", architecture->get_cross_prefix(), cmd);
37 bool Tool::accepts_suffix(const string &suffix, bool aux) const
39 if(find(input_suffixes.begin(), input_suffixes.end(), suffix)!=input_suffixes.end())
42 return find(aux_suffixes.begin(), aux_suffixes.end(), suffix)!=aux_suffixes.end();
47 Target *Tool::create_target(Target &source, const string &arg)
49 list<Target *> sources;
50 sources.push_back(&source);
51 return create_target(sources, arg);
61 if(!executable && !command.empty())
63 executable = builder.get_vfs().find_binary(command);
65 problems.push_back(format("Can't find executable %s", command));
70 SubTool::SubTool(Tool &p):