FileTarget *tgt = 0;
for(SearchPath::const_iterator j=path.begin(); (!tgt && j!=path.end()); ++j)
- tgt = get_header(FS::Path(*j)/name);
+ tgt = get_header(FS::Path(*j)/name, *tool);
for(Tool::SearchPath::const_iterator j=syspath.begin(); (!tgt && j!=syspath.end()); ++j)
- tgt = get_header(FS::Path(*j)/name);
+ tgt = get_header(FS::Path(*j)/name, *tool);
include_cache.insert(TargetMap::value_type(id, tgt));
return tgt;
}
-FileTarget *VirtualFileSystem::get_header(const FS::Path &fn)
+FileTarget *VirtualFileSystem::get_header(const FS::Path &fn, const Tool &tool)
{
- FileTarget *tgt = get_target(fn);
- if(tgt)
+ if(FileTarget *tgt = get_target(fn))
return tgt;
if(FS::is_reg(fn))
- {
- tgt = new CSourceFile(builder, fn);
- return tgt;
- }
+ return dynamic_cast<FileTarget *>(tool.create_source(fn));
+
return 0;
}
target of one was found, or a new SystemHeader target if there was no known
target but the file exists.
*/
- FileTarget *get_header(const Msp::FS::Path &);
+ FileTarget *get_header(const Msp::FS::Path &, const Tool &);
FileTarget *get_library(const std::string &, const Msp::FS::Path &, LibMode);