builder.get_logger().log("vfs", format("Path %s registered to %s", path, t->get_name()));
}
-FileTarget *VirtualFileSystem::find_header(const string &name, const Tool *tool, const SearchPath &path, bool use_syspath)
+FileTarget *VirtualFileSystem::find_header(const string &name, Tool *tool, const SearchPath &path, bool use_syspath)
{
if(!tool)
tool = builder.get_toolchain().get_tool_for_suffix(FS::extpart(FS::basename(name)), true);
if(!tool)
return 0;
+ tool->prepare();
+
list<FS::Path> combined_path(path.begin(), path.end());
if(use_syspath)
{
list<FS::Path> combined_path(path.begin(), path.end());
if(use_syspath)
{
- const Tool &linker = builder.get_toolchain().get_tool("LINK");
+ Tool &linker = builder.get_toolchain().get_tool("LINK");
+ linker.prepare();
const Tool::SearchPath &syspath = linker.get_system_path();
combined_path.insert(combined_path.end(), syspath.begin(), syspath.end());
}
/** Locates a source file. If a file is found but no target is associated
with it, a new package-less target is created with the appropriate tool. If
use_syspath is true, the system path reported by the tool is also searched. */
- FileTarget *find_header(const std::string &, const Tool *, const SearchPath &, bool use_syspath = true);
+ FileTarget *find_header(const std::string &, Tool *, const SearchPath &, bool use_syspath = true);
/** Locates a library. The library name should be the same as what would be
used in linking with the library. If a file is found but no target is