architecture(0),
tag(t),
executable(0),
+ processing_unit(ONE_FILE),
prepared(false)
{ }
architecture(&a),
tag(t),
executable(0),
+ processing_unit(ONE_FILE),
prepared(false)
{ }
if(cmd.empty())
throw invalid_argument("Tool::set_command");
- if(cross && architecture->is_cross())
+ if(cross && architecture->is_cross() && !FS::Path(cmd).is_absolute())
command = format("%s-%s", architecture->get_cross_prefix(), cmd);
else
command = cmd;
Tool(p),
parent(p)
{ }
+
+
+void operator>>(const LexicalConverter &conv, Tool::ProcessingUnit &unit)
+{
+ const string &str = conv.get();
+ if(str=="FILE")
+ unit = Tool::ONE_FILE;
+ else if(str=="DIRECTORY")
+ unit = Tool::DIRECTORY;
+ else if(str=="COMPONENT")
+ unit = Tool::COMPONENT;
+ else
+ throw lexical_error(format("conversion of '%s' to ProcessingUnit", str));
+}