aboutsummaryrefslogtreecommitdiff
path: root/build/scope
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-02 11:37:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-02 11:37:15 +0200
commit9891b20350021ce41a950645dd76df20a45c92cc (patch)
tree0cd27041b0c3413e17b9319ae99e87c5e745b1ff /build/scope
parent74212589a797ca75e55f92a522e198915c0dbaf6 (diff)
Implement optional module loading
The syntax is: using? cli Now each module use results in two bool variables: <module>.loaded and <module>.configured. Also implement variable visibility (the above two variables are limited to project).
Diffstat (limited to 'build/scope')
-rw-r--r--build/scope21
1 files changed, 15 insertions, 6 deletions
diff --git a/build/scope b/build/scope
index 1cfbc10..e52f615 100644
--- a/build/scope
+++ b/build/scope
@@ -76,25 +76,34 @@ namespace build
// in this scope, do it on the the variables map directly.
//
build::lookup<const value>
- operator[] (const variable&) const;
+ operator[] (const variable& var) const
+ {
+ return lookup (nullptr, nullptr, var);
+ }
build::lookup<const value>
operator[] (const std::string& name) const
{
- return operator[] (variable_pool.find (name));
+ return operator[] (var_pool.find (name));
}
// As above, but includes target type/pattern-specific variables.
//
build::lookup<const value>
- lookup (const target_type&, const string& name, const variable&) const;
+ lookup (const target_key& tk, const variable& var) const
+ {
+ return lookup (tk.type, tk.name, var);
+ }
build::lookup<const value>
- lookup (const target_type& tt, const string& n, const string& var) const
+ lookup (const target_key& tk, const string& var) const
{
- return lookup (tt, n, variable_pool.find (var));
+ return lookup (tk, var_pool.find (var));
}
+ build::lookup<const value>
+ lookup (const target_type*, const string* name, const variable&) const;
+
// Return a value suitable for assignment (or append if you only
// want to append to the value from this scope). If the variable
// does not exist in this scope's map, then a new one with the
@@ -119,7 +128,7 @@ namespace build
value&
append (const std::string& name)
{
- return append (variable_pool.find (name));
+ return append (var_pool.find (name));
}
// Target type/pattern-specific variables.