aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/utility.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-22 14:38:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-23 18:14:07 +0200
commit5035f4ef68922ac758b1e4734e67d73c9228010b (patch)
tree271fdd5b1d6e995a058d97aacb3ac90a538d9ff1 /libbuild2/config/utility.cxx
parent8793941652d6aa1c3d02b2f87f691e6d06254b7d (diff)
Introduce notion of build context
All non-const global state is now in class context and we can now have multiple independent builds going on at the same time.
Diffstat (limited to 'libbuild2/config/utility.cxx')
-rw-r--r--libbuild2/config/utility.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/libbuild2/config/utility.cxx b/libbuild2/config/utility.cxx
index 746639d..355e896 100644
--- a/libbuild2/config/utility.cxx
+++ b/libbuild2/config/utility.cxx
@@ -46,7 +46,7 @@ namespace build2
}
}
- if (l.defined () && current_mif->id == configure_id)
+ if (l.defined () && r.ctx.current_mif->id == configure_id)
save_variable (r, var);
return pair<lookup, bool> (l, n);
@@ -55,7 +55,7 @@ namespace build2
lookup
optional (scope& r, const variable& var)
{
- if (current_mif->id == configure_id)
+ if (r.ctx.current_mif->id == configure_id)
save_variable (r, var);
auto l (r[var]);
@@ -75,7 +75,7 @@ namespace build2
// any original values, they will be "visible"; see find_override() for
// details.
//
- const variable& vns (var_pool.rw (r).insert ("config." + n));
+ const variable& vns (r.ctx.var_pool.rw (r).insert ("config." + n));
for (scope* s (&r); s != nullptr; s = s->parent_scope ())
{
for (auto p (s->vars.find_namespace (vns));
@@ -101,9 +101,9 @@ namespace build2
// Pattern-typed in boot() as bool.
//
const variable& var (
- var_pool.rw (rs).insert ("config." + n + ".configured"));
+ rs.ctx.var_pool.rw (rs).insert ("config." + n + ".configured"));
- if (current_mif->id == configure_id)
+ if (rs.ctx.current_mif->id == configure_id)
save_variable (rs, var);
auto l (rs[var]); // Include inherited values.
@@ -116,9 +116,9 @@ namespace build2
// Pattern-typed in boot() as bool.
//
const variable& var (
- var_pool.rw (rs).insert ("config." + n + ".configured"));
+ rs.ctx.var_pool.rw (rs).insert ("config." + n + ".configured"));
- if (current_mif->id == configure_id)
+ if (rs.ctx.current_mif->id == configure_id)
save_variable (rs, var);
value& x (rs.assign (var));
@@ -135,7 +135,7 @@ namespace build2
void
save_variable (scope& r, const variable& var, uint64_t flags)
{
- if (current_mif->id != configure_id)
+ if (r.ctx.current_mif->id != configure_id)
return;
// The project might not be using the config module. But then how
@@ -148,7 +148,7 @@ namespace build2
void
save_module (scope& r, const char* name, int prio)
{
- if (current_mif->id != configure_id)
+ if (r.ctx.current_mif->id != configure_id)
return;
if (module* m = r.lookup_module<module> (module::name))