aboutsummaryrefslogtreecommitdiff
path: root/build2/scope.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-11-08 12:45:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-11-08 12:45:33 +0200
commitdbb7a5ffefefa1e6439464cac47ebfd90a913aa7 (patch)
treebec6ea433f5ae1cd7c7eaddd3f57fa82a6cb4960 /build2/scope.ixx
parent0c2c473c9937a54562bbf767cc5450f6c03bcce6 (diff)
Fix bug in override logic for command line variable with project visibility
Diffstat (limited to 'build2/scope.ixx')
-rw-r--r--build2/scope.ixx12
1 files changed, 12 insertions, 0 deletions
diff --git a/build2/scope.ixx b/build2/scope.ixx
index 9a93e9d..ac71e82 100644
--- a/build2/scope.ixx
+++ b/build2/scope.ixx
@@ -39,4 +39,16 @@ namespace build2
for (; r->parent_->root_ != nullptr; r = r->parent_->root_) ;
return r;
}
+
+ inline bool scope::
+ sub_root (const scope& r) const
+ {
+ // Scan the parent root scope chain looking for this scope.
+ //
+ for (const scope* pr (&r); (pr = pr->parent_->root_) != nullptr; )
+ if (pr == this)
+ return true;
+
+ return false;
+ }
}