From 26146d391f179dd9e4e5e1f70a52ba99d6a0847d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 1 Apr 2016 09:49:18 +0200 Subject: Get part of variable override implementation --- build2/variable | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'build2/variable') diff --git a/build2/variable b/build2/variable index 15f9c47..d22d6da 100644 --- a/build2/variable +++ b/build2/variable @@ -79,6 +79,10 @@ namespace build2 // // @@ Document override semantics. // + // Note that we don't propagate variable type to override variables and we + // keep override values as untyped names. So they get "typed" when they are + // applied. + // struct variable { string name; @@ -111,7 +115,7 @@ namespace build2 // Creation. A newly created value is NULL and can be reset back to NULL // by assigning nullptr. Values can be copied and copy-assigned. Note that - // for assignment, the values' types should be the same of LHS should be + // for assignment, the values' types should be the same or LHS should be // untyped. // // @@ -672,6 +676,17 @@ namespace build2 lookup find (const target_type&, const string& tname, const variable&) const; }; + + // Override cache. + // + struct variable_override_value + { + build2::value value; + const variable_map* stem_vars = nullptr; // NULL means there is no stem. + }; + + extern std::map variable_override_cache; } #include -- cgit v1.1