From 9e6303e86dae25096ee62d74abfca4456be6a96f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Apr 2015 14:51:53 +0200 Subject: 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. --- build/scope.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'build/scope.cxx') 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; -- cgit v1.1