From 74212589a797ca75e55f92a522e198915c0dbaf6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 1 Dec 2015 15:37:04 +0200 Subject: 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 --- build/scope | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'build/scope') 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 + build::lookup operator[] (const variable&) const; - lookup + build::lookup operator[] (const std::string& name) const { return operator[] (variable_pool.find (name)); } + // As above, but includes target type/pattern-specific variables. + // + build::lookup + lookup (const target_type&, const string& name, const variable&) const; + + build::lookup + 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 -- cgit v1.1