aboutsummaryrefslogtreecommitdiff
path: root/build2/context
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-03-31 09:01:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-03-31 09:01:50 +0200
commit6417a4e6af2b7732ec0da6af24f1a56f7cdada3f (patch)
tree58ffae7ef0cdac55acd6d498dfc66ce0967f4e9a /build2/context
parent31bd69c56bc29ec1c154a7c0623b6f0ccce78af1 (diff)
Set part of variable override implementation
Diffstat (limited to 'build2/context')
-rw-r--r--build2/context15
1 files changed, 14 insertions, 1 deletions
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<variable_override>;
+
// 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