X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcomponent.cpp;h=2d09f8a0cd007ed12f9e7c09d2a1c78cc4670b47;hb=dc0893c6f6d89fee489a620e0814b4e8a8af9e91;hp=bebe3f7790f4c6b20d874a6208e40583f2d6f083;hpb=0e76f1c82e89feea5f49ce20b771fd304bd93bd3;p=builder.git diff --git a/source/component.cpp b/source/component.cpp index bebe3f7..2d09f8a 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -59,6 +59,19 @@ BuildInfo Component::get_build_info_for_path(const FS::Path &path) const { // XXX Cache these and check that the directories actually exist before adding them BuildInfo binfo = build_info; + + FS::Path gen_dir = package.get_temp_directory()/"generated"; + if(FS::descendant_depth(path, gen_dir)>=0) + { + FS::Path subdir = FS::dirname(FS::relative(path, gen_dir)); + binfo.local_incpath.push_back(package.get_source_directory()/subdir); + } + else + { + FS::Path subdir = FS::dirname(FS::relative(path, package.get_source_directory())); + binfo.local_incpath.push_back(gen_dir/subdir); + } + if(!overlays.empty()) { FS::Path dir = FS::dirname(path); @@ -101,8 +114,8 @@ Component::SourceList Component::collect_source_files() const for(SourceList::const_iterator j=dirs.begin(); j!=dirs.end(); ++j) { package.get_builder().get_logger().log("files", format("Traversing %s", *j)); - list sfiles = list_files(*j); - for(list::iterator k=sfiles.begin(); k!=sfiles.end(); ++k) + vector sfiles = list_files(*j); + for(vector::iterator k=sfiles.begin(); k!=sfiles.end(); ++k) { if(j!=dirs.begin()) { @@ -110,7 +123,9 @@ Component::SourceList Component::collect_source_files() const continue; overlay_files.insert(*k); } - files.push_back(*j / *k); + FS::Path fn = *j / *k; + if(!FS::is_dir(fn)) + files.push_back(fn); } } }