From 6417a4e6af2b7732ec0da6af24f1a56f7cdada3f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 31 Mar 2016 09:01:50 +0200 Subject: Set part of variable override implementation --- build2/context | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'build2/context') diff --git a/build2/context b/build2/context index 661d9ff..bd56dbb 100644 --- a/build2/context +++ b/build2/context @@ -17,6 +17,7 @@ namespace build2 { class scope; class file; + struct variable; extern dir_path work; extern dir_path home; @@ -41,10 +42,22 @@ namespace build2 // extern uint64_t dependency_count; + // Project-wide (as opposed to global) variable overrides. Returned by + // reset(). + // + struct variable_override + { + const variable& var; // Original variable. + const variable& ovr; // Override variable. + names val; + }; + + using variable_overrides = vector; + // Reset the build state. In particular, this removes all the targets, // scopes, and variables. // - void + variable_overrides reset (const strings& cmd_vars); // The dual interface wrapper for the {mk,rm}{file,dir}() functions -- cgit v1.1