diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-07 14:51:53 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-07 14:51:53 +0200 |
commit | 9e6303e86dae25096ee62d74abfca4456be6a96f (patch) | |
tree | 58be935e7a1cc2843d251456478d8cc6ec1ad01a /build/scope.cxx | |
parent | 088a60c512aff26eeb026c516d0afe724880cb2b (diff) |
Initial support for amalgamation/subprojects
For now both need to be manually specified in src bootstrap. At
this stage main() loads any outer root scopes while include loads
any inner.
Diffstat (limited to 'build/scope.cxx')
-rw-r--r-- | build/scope.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/build/scope.cxx b/build/scope.cxx index cdca747..68eba3d 100644 --- a/build/scope.cxx +++ b/build/scope.cxx @@ -64,10 +64,10 @@ namespace build if (p == nullptr) p = c.parent_; - if (root) + if (root && c.root_ == p->root_) // No intermediate root. c.root_ = &s; - if (p == c.parent_) // A scope without an intermediate parent. + if (p == c.parent_) // No intermediate parent. c.parent_ = &s; } @@ -90,7 +90,9 @@ namespace build for (++r.first; r.first != r.second; ++r.first) { scope& c (r.first->second); - c.root_ = &s; + + if (c.root_ == s.root_) // No intermediate root. + c.root_ = &s; } s.root_ = &s; |