void VirtualFileSystem::register_path(const FS::Path &path, FileTarget *t)
{
- targets.insert(TargetMap::value_type(path.str(), t));
+ targets.insert({ path, t });
nonexistent.erase(path);
builder.get_logger().log("vfs", format("Path %s registered to %s", path, t->get_name()));
}
tool->prepare();
- list<FS::Path> 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());
}
FileTarget *VirtualFileSystem::find_library(const string &lib, const SearchPath &path, BuildInfo::LibraryMode mode, bool use_syspath)
{
- list<FS::Path> 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());
}
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)