diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-08 14:40:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-08 14:40:15 +0200 |
commit | 650d61845b3f61e9596a8a2dc97458998ba26013 (patch) | |
tree | b0ce0b66bfd053ffb38849589404957cde0f12dc /build/config/operation.cxx | |
parent | 402bb6e6b297614226c4f848ebdb13fd49a95d76 (diff) |
Implement automatic amalgamation discovery
Diffstat (limited to 'build/config/operation.cxx')
-rw-r--r-- | build/config/operation.cxx | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/build/config/operation.cxx b/build/config/operation.cxx index e6c258c..300dd22 100644 --- a/build/config/operation.cxx +++ b/build/config/operation.cxx @@ -85,9 +85,10 @@ namespace build << "# feel free to edit." << endl << "#" << endl; - if (auto v = root.vars["amalgamation"]) + auto av = root.vars["amalgamation"]; + if (av && !av.empty ()) { - const dir_path& d (v.as<const dir_path&> ()); + const dir_path& d (av.as<const dir_path&> ()); ofs << "# Base configuration inherited from " << d << endl << "#" << endl; @@ -276,20 +277,20 @@ namespace build // Create and bootstrap subproject's root scope. // dir_path out_nroot (out_root / n.dir); - dir_path src_nroot (src_root / n.dir); - scope& nroot (create_root (out_nroot, src_nroot)); + // The same logic to src_root as in create_bootstrap_inner(). + // + scope& nroot (create_root (out_nroot, dir_path ())); bootstrap_out (nroot); - // Check if the bootstrap process changed src_root. - // - const dir_path& p (nroot.vars["src_root"].as<const dir_path&> ()); + auto val (nroot.assign ("src_root")); - if (src_nroot != p) - fail << "bootstrapped src_root " << p << " does not match " - << "subproject " << src_nroot; + if (!val) + val = is_src_root (out_nroot) + ? out_nroot + : (src_root / n.dir); - nroot.src_path_ = &p; + nroot.src_path_ = &val.as<const dir_path&> (); bootstrap_src (nroot); |