From: Mikko Rasa Date: Sat, 17 Dec 2022 00:16:54 +0000 (+0200) Subject: Add the corresponding generated source directory to local include path X-Git-Url: http://git.tdb.fi/?p=builder.git;a=commitdiff_plain;h=dc0893c6f6d89fee489a620e0814b4e8a8af9e91 Add the corresponding generated source directory to local include path This allows generated headers to be used as normal. --- diff --git a/source/component.cpp b/source/component.cpp index 46e9294..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);