X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvirtualfilesystem.cpp;h=c9bfd23b0c564700ea7e1d13542c0c1118cbf6fc;hb=564160e126f525dda52f27044d29b479088da191;hp=7855e04ac99bc148bbbc2dbd4c685fafd01214e3;hpb=1ec533a7777be4dce9c8b6bbb1cbc32d38098ae4;p=builder.git diff --git a/source/virtualfilesystem.cpp b/source/virtualfilesystem.cpp index 7855e04..c9bfd23 100644 --- a/source/virtualfilesystem.cpp +++ b/source/virtualfilesystem.cpp @@ -44,10 +44,10 @@ FileTarget *VirtualFileSystem::find_header(const string &name, Tool *tool, const tool->prepare(); - list combined_path(path.begin(), path.end()); + SearchPath combined_path = path; if(use_syspath) { - const Tool::SearchPath &syspath = tool->get_system_path(); + const SearchPath &syspath = tool->get_system_path(); combined_path.insert(combined_path.end(), syspath.begin(), syspath.end()); } @@ -73,12 +73,12 @@ FileTarget *VirtualFileSystem::find_header(const string &name, Tool *tool, const FileTarget *VirtualFileSystem::find_library(const string &lib, const SearchPath &path, BuildInfo::LibraryMode mode, bool use_syspath) { - list combined_path(path.begin(), path.end()); + SearchPath combined_path = path; if(use_syspath) { Tool &linker = builder.get_toolchain().get_tool("LINK"); linker.prepare(); - const Tool::SearchPath &syspath = linker.get_system_path(); + const SearchPath &syspath = linker.get_system_path(); combined_path.insert(combined_path.end(), syspath.begin(), syspath.end()); } @@ -146,17 +146,21 @@ FileTarget *VirtualFileSystem::find_binary(const string &name) path.push_back("/"); else { - string env_path = Msp::getenv("PATH"); - if(!env_path.empty()) + if(sys_bin_path.empty()) { - for(const string &p: split(env_path, ':')) - path.push_back(p); - } - else - { - path.push_back("/bin"); - path.push_back("/usr/bin"); + string env_path = Msp::getenv("PATH"); + if(!env_path.empty()) + { + for(const string &p: split(env_path, ':')) + sys_bin_path.push_back(p); + } + else + { + sys_bin_path.push_back("/bin"); + sys_bin_path.push_back("/usr/bin"); + } } + path = sys_bin_path; } for(const FS::Path &p: path)