aboutsummaryrefslogtreecommitdiff
path: root/build/scope
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-01 15:37:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-01 15:37:04 +0200
commit74212589a797ca75e55f92a522e198915c0dbaf6 (patch)
tree6e16ed2ed816c66a0c3edef74c1f1e050fa0e272 /build/scope
parent10fd2aface4486fc7f873dd2b54a1c2073c0b434 (diff)
Use 'extension' variable to resolve extension for file{}
We now also check target type/pattern-specific variables. So the new usage is: cli{*}: extension = cli
Diffstat (limited to 'build/scope')
-rw-r--r--build/scope15
1 files changed, 13 insertions, 2 deletions
diff --git a/build/scope b/build/scope
index 8b0d0ad..1cfbc10 100644
--- a/build/scope
+++ b/build/scope
@@ -75,15 +75,26 @@ namespace build
// Lookup, including in outer scopes. If you only want to lookup
// in this scope, do it on the the variables map directly.
//
- lookup<const value>
+ build::lookup<const value>
operator[] (const variable&) const;
- lookup<const value>
+ build::lookup<const value>
operator[] (const std::string& name) const
{
return operator[] (variable_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;
+
+ build::lookup<const value>
+ lookup (const target_type& tt, const string& n, const string& var) const
+ {
+ return lookup (tt, n, variable_pool.find (var));
+ }
+
// 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