From ad4120afce8c7bc4001fc0173a0ff7611ec0198d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 12 Dec 2015 13:46:07 +0200 Subject: Implement installation of prerequisite shared libraries --- build/scope | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'build/scope') diff --git a/build/scope b/build/scope index 551ce9d..0cb319f 100644 --- a/build/scope +++ b/build/scope @@ -39,6 +39,9 @@ namespace build const dir_path* out_path_ {nullptr}; const dir_path* src_path_ {nullptr}; + bool + root () const {return root_ == this;} + scope* parent_scope () const {return parent_;} @@ -64,8 +67,19 @@ namespace build : nullptr; } - bool - root () const {return root_ == this;} + // Root scope of the outermost amalgamation or NULL if this scope is not + // (yet) in any (known) project. If there is no amalgamation, then this + // function returns the root scope of the project (in other words, in this + // case a project is treated as its own amalgamation). + // + scope* + weak_scope () const + { + scope* r (root_); + if (r != nullptr) + for (; r->parent_->root_ != nullptr; r = r->parent_->root_) ; + return r; + } // Variables. // -- cgit v1.1