diff options
-rw-r--r-- | build2/file.cxx | 9 | ||||
-rw-r--r-- | build2/file.hxx | 10 |
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 ()); |