return;
const SourcePackage &spkg = component->get_package();
- string deps_key = FS::relative(path, spkg.get_source_directory()).str();
- DependencyCache &deps_cache = spkg.get_dependency_cache();
- if(mtime<deps_cache.get_mtime() && deps_cache.has_deps(deps_key))
- includes = deps_cache.get_deps(deps_key);
+ Cache &cache = spkg.get_cache();
+ if(mtime<cache.get_mtime() && cache.has_key(this, "includes"))
+ includes = cache.get_values(this, "includes");
else
{
IO::BufferedFile in(path.str());
if(RegMatch match = r_include.match(line))
includes.push_back(match[1].str);
- deps_cache.set_deps(deps_key, includes);
+ cache.set_values(this, "includes", includes);
}
- const BuildInfo::PathList &incpath = component->get_build_info().incpath;
+ const BuildInfo &build_info = component->get_build_info_for_path(path);
+ const BuildInfo::PathList &incpath = build_info.incpath;
BuildInfo::PathList local_incpath = incpath;
+ local_incpath.insert(local_incpath.begin(), build_info.local_incpath.begin(), build_info.local_incpath.end());
local_incpath.push_front(FS::dirname(path).str());
- for(list<string>::iterator i=includes.begin(); i!=includes.end(); ++i)
+ for(IncludeList::iterator i=includes.begin(); i!=includes.end(); ++i)
{
Target *hdr = builder.get_vfs().find_header(i->substr(1), ((*i)[0]=='"' ? local_incpath : incpath));
if(hdr)
add_dependency(*hdr);
}
}
+
+void CSourceFile::modified()
+{
+ includes.clear();
+ depends.clear();
+ find_dependencies();
+}