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;
FileTarget *VirtualFileSystem::find_binary(const string &name)
{
SearchPath path;
- if(const char *env_path = getenv("PATH"))
+ if(FS::Path(name).is_absolute())
+ path.push_back("/");
+ else if(const char *env_path = getenv("PATH"))
{
vector<string> parts = split(env_path, ':');
for(vector<string>::const_iterator i=parts.begin(); i!=parts.end(); ++i)