- const PathList &host_src=module_host->get_sources();
- for(PathList::const_iterator i=host_src.begin(); i!=host_src.end(); ++i)
- build_info.incpath.push_back(i->str());
+ FS::Path path(*i);
+ if(FS::is_dir(path))
+ {
+ SourceList dirs;
+ dirs.push_back(path);
+ for(OverlayList::const_iterator j=overlays.begin(); j!=overlays.end(); ++j)
+ {
+ FS::Path opath = path / *j;
+ if(FS::is_dir(opath))
+ dirs.push_back(opath);
+ }
+ set<string> overlay_files;
+ for(SourceList::const_iterator j=dirs.begin(); j!=dirs.end(); ++j)
+ {
+ package.get_builder().get_logger().log("files", format("Traversing %s", *j));
+ list<string> sfiles = list_files(*j);
+ for(list<string>::iterator k=sfiles.begin(); k!=sfiles.end(); ++k)
+ {
+ if(j!=dirs.begin())
+ {
+ if(overlay_files.count(*k))
+ continue;
+ overlay_files.insert(*k);
+ }
+ FS::Path fn = *j / *k;
+ if(!FS::is_dir(fn))
+ files.push_back(fn);
+ }
+ }
+ }
+ else
+ {
+ files.push_back(path);
+ for(OverlayList::const_iterator j=overlays.begin(); j!=overlays.end(); ++j)
+ {
+ FS::Path opath = FS::dirname(path)/ *j/FS::basename(path);
+ if(FS::is_reg(opath))
+ files.push_back(opath);
+ }
+ }