aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-05-23 12:44:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-05-23 12:44:56 +0200
commit954c9ac620a3f37d45ce2aa3bd35564a519b1143 (patch)
tree33173480108c51b6a04a3f508bdb45984f8085ac
parent437b71971053caaaa4d3e7bc406c8e0bd26e3db7 (diff)
Fix bug in inner project bootstrap during configure/disfigure
-rw-r--r--build2/file.cxx9
-rw-r--r--build2/file.hxx10
2 files changed, 13 insertions, 6 deletions
diff --git a/build2/file.cxx b/build2/file.cxx
index 89c811d..3cb6980 100644
--- a/build2/file.cxx
+++ b/build2/file.cxx
@@ -940,6 +940,8 @@ namespace build2
scope&
create_bootstrap_inner (scope& root, const dir_path& out_base)
{
+ scope* r (&root);
+
if (auto l = root.vars[var_subprojects])
{
for (const auto& p: cast<subprojects> (l))
@@ -986,11 +988,14 @@ namespace build2
// See if there are more inner roots.
//
- return create_bootstrap_inner (rs, out_base);
+ r = &create_bootstrap_inner (rs, out_base);
+
+ if (!out_base.empty ())
+ break; // We have found our subproject.
}
}
- return root;
+ return *r;
}
void
diff --git a/build2/file.hxx b/build2/file.hxx
index 7f319cd..bb136cf 100644
--- a/build2/file.hxx
+++ b/build2/file.hxx
@@ -165,10 +165,12 @@ namespace build2
void
create_bootstrap_outer (scope& root);
- // Create and bootstrap inner root scopes between root and base, if any. If
- // out_base is empty, then bootstrap all the way in. Return the innermost
- // created root scope or root if none were created. Note: loading is done by
- // load_root().
+ // Create and bootstrap inner root scopes, if any, recursively.
+ //
+ // If out_base is not empty, then only bootstrap scope between root and base
+ // returning the innermost created root scope or root if none were created.
+ //
+ // Note that loading is done by load_root().
//
scope&
create_bootstrap_inner (scope& root, const dir_path& out_base = dir_path ());