#include <msp/fs/dir.h>
#include <msp/fs/stat.h>
#include <msp/fs/utils.h>
-#include <msp/io/print.h>
-#include <msp/strings/lexicalcast.h>
+#include <msp/strings/format.h>
#include "builder.h"
#include "component.h"
#include "sourcepackage.h"
{
// 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);
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)
+ vector<string> sfiles = list_files(*j);
+ for(vector<string>::iterator k=sfiles.begin(); k!=sfiles.end(); ++k)
{
if(j!=dirs.begin())
{
continue;
overlay_files.insert(*k);
}
- files.push_back(*j / *k);
+ FS::Path fn = *j / *k;
+ if(!FS::is_dir(fn))
+ files.push_back(fn);
}
}
}