aboutsummaryrefslogtreecommitdiff
path: root/build/dist/operation.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-11-28 17:24:21 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-11-28 17:24:21 +0200
commit99ccefe993f4ecae4bccf334d598fa3e92dc186e (patch)
tree023baf0e37435412f3fd0dbd72a7be41fad15818 /build/dist/operation.cxx
parentd7d34c979b45b4c3746d34cc8a33dce4989e100d (diff)
Include export.build from loaded, src-amalgamated subprojects
Diffstat (limited to 'build/dist/operation.cxx')
-rw-r--r--build/dist/operation.cxx28
1 files changed, 25 insertions, 3 deletions
diff --git a/build/dist/operation.cxx b/build/dist/operation.cxx
index 3928759..0fb3aef 100644
--- a/build/dist/operation.cxx
+++ b/build/dist/operation.cxx
@@ -156,9 +156,9 @@ namespace build
// ignored on the next step if the user explicitly marked them
// nodist.
//
- auto add_adhoc = [&src_root, &trace] (const char* f)
+ auto add_adhoc = [&src_root, &trace] (const dir_path& d, const char* f)
{
- path p (src_root / path (f));
+ path p (d / path (f));
if (file_exists (p))
{
const char* e (p.extension ());
@@ -170,7 +170,29 @@ namespace build
}
};
- add_adhoc ("build/export.build");
+ add_adhoc (src_root, "build/export.build");
+
+ // The same for subprojects that have been loaded.
+ //
+ if (auto l = rs->vars["subprojects"])
+ {
+ for (auto p: as<subprojects> (*l))
+ {
+ const dir_path& pd (p.second);
+ dir_path out_nroot (out_root / pd);
+ scope& nrs (scopes.find (out_nroot));
+
+ if (nrs.out_path () != out_nroot) // This subproject not loaded.
+ continue;
+
+ const dir_path& src_nroot (nrs.src_path ());
+
+ if (!src_nroot.sub (src_root)) // Not a source-level amalgamation.
+ continue;
+
+ add_adhoc (src_nroot, "build/export.build");
+ }
+ }
// Collect the files. We want to take the snapshot of targets
// since updating some of them may result in more targets being