aboutsummaryrefslogtreecommitdiff
path: root/build/scope
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-12 13:46:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-12 13:46:07 +0200
commitad4120afce8c7bc4001fc0173a0ff7611ec0198d (patch)
treeebbc31d03feda96560df437247b63206489a1139 /build/scope
parentdd4a389117812f0d3b45473d87214d67d0cb4a3a (diff)
Implement installation of prerequisite shared libraries
Diffstat (limited to 'build/scope')
-rw-r--r--build/scope18
1 files changed, 16 insertions, 2 deletions
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.
//