aboutsummaryrefslogtreecommitdiff
path: root/build2/bin
diff options
context:
space:
mode:
Diffstat (limited to 'build2/bin')
-rw-r--r--build2/bin/init.cxx12
-rw-r--r--build2/bin/target.cxx36
2 files changed, 26 insertions, 22 deletions
diff --git a/build2/bin/init.cxx b/build2/bin/init.cxx
index b46d643..4e80834 100644
--- a/build2/bin/init.cxx
+++ b/build2/bin/init.cxx
@@ -56,7 +56,7 @@ namespace build2
// Target is a string and not target_triplet because it can be
// specified by the user.
//
- auto& vp (var_pool.rw (rs));
+ auto& vp (rs.ctx.var_pool.rw (rs));
vp.insert<string> ("config.bin.target", true);
vp.insert<string> ("config.bin.pattern", true);
@@ -266,7 +266,7 @@ namespace build2
// config.bin.target
//
{
- const variable& var (var_pool["config.bin.target"]);
+ const variable& var (rs.ctx.var_pool["config.bin.target"]);
// We first see if the value was specified via the configuration
// mechanism.
@@ -343,7 +343,7 @@ namespace build2
// config.bin.pattern
//
{
- const variable& var (var_pool["config.bin.pattern"]);
+ const variable& var (rs.ctx.var_pool["config.bin.pattern"]);
// We first see if the value was specified via the configuration
// mechanism.
@@ -568,7 +568,7 @@ namespace build2
//
if (first)
{
- auto& v (var_pool.rw (rs));
+ auto& v (rs.ctx.var_pool.rw (rs));
v.insert<process_path> ("bin.ar.path");
v.insert<process_path> ("bin.ranlib.path");
@@ -744,7 +744,7 @@ namespace build2
//
if (first)
{
- auto& v (var_pool.rw (rs));
+ auto& v (rs.ctx.var_pool.rw (rs));
v.insert<process_path> ("bin.ld.path");
v.insert<path> ("config.bin.ld", true);
@@ -857,7 +857,7 @@ namespace build2
//
if (first)
{
- auto& v (var_pool.rw (rs));
+ auto& v (rs.ctx.var_pool.rw (rs));
v.insert<process_path> ("bin.rc.path");
v.insert<path> ("config.bin.rc", true);
diff --git a/build2/bin/target.cxx b/build2/bin/target.cxx
index ec4a0ef..2ef3d87 100644
--- a/build2/bin/target.cxx
+++ b/build2/bin/target.cxx
@@ -88,11 +88,12 @@ namespace build2
//
template <typename M, typename G>
static target*
- m_factory (const target_type&, dir_path dir, dir_path out, string n)
+ m_factory (context& ctx,
+ const target_type&, dir_path dir, dir_path out, string n)
{
- const G* g (targets.find<G> (dir, out, n));
+ const G* g (ctx.targets.find<G> (dir, out, n));
- M* m (new M (move (dir), move (out), move (n)));
+ M* m (new M (ctx, move (dir), move (out), move (n)));
m->group = g;
return m;
@@ -258,21 +259,22 @@ namespace build2
//
template <typename G, typename E, typename A, typename S>
static target*
- g_factory (const target_type&, dir_path dir, dir_path out, string n)
+ g_factory (context& ctx,
+ const target_type&, dir_path dir, dir_path out, string n)
{
// Casts are MT-aware (during serial load).
//
E* e (phase == run_phase::load
- ? const_cast<E*> (targets.find<E> (dir, out, n))
+ ? const_cast<E*> (ctx.targets.find<E> (dir, out, n))
: nullptr);
A* a (phase == run_phase::load
- ? const_cast<A*> (targets.find<A> (dir, out, n))
+ ? const_cast<A*> (ctx.targets.find<A> (dir, out, n))
: nullptr);
S* s (phase == run_phase::load
- ? const_cast<S*> (targets.find<S> (dir, out, n))
+ ? const_cast<S*> (ctx.targets.find<S> (dir, out, n))
: nullptr);
- G* g (new G (move (dir), move (out), move (n)));
+ G* g (new G (ctx, move (dir), move (out), move (n)));
if (e != nullptr) e->group = g;
if (a != nullptr) a->group = g;
@@ -323,16 +325,17 @@ namespace build2
// The same as g_factory() but without E.
//
static target*
- libul_factory (const target_type&, dir_path dir, dir_path out, string n)
+ libul_factory (context& ctx,
+ const target_type&, dir_path dir, dir_path out, string n)
{
libua* a (phase == run_phase::load
- ? const_cast<libua*> (targets.find<libua> (dir, out, n))
+ ? const_cast<libua*> (ctx.targets.find<libua> (dir, out, n))
: nullptr);
libus* s (phase == run_phase::load
- ? const_cast<libus*> (targets.find<libus> (dir, out, n))
+ ? const_cast<libus*> (ctx.targets.find<libus> (dir, out, n))
: nullptr);
- libul* g (new libul (move (dir), move (out), move (n)));
+ libul* g (new libul (ctx, move (dir), move (out), move (n)));
if (a != nullptr) a->group = g;
if (s != nullptr) s->group = g;
@@ -403,18 +406,19 @@ namespace build2
}
static target*
- lib_factory (const target_type&, dir_path dir, dir_path out, string n)
+ lib_factory (context& ctx,
+ const target_type&, dir_path dir, dir_path out, string n)
{
// Casts are MT-aware (during serial load).
//
liba* a (phase == run_phase::load
- ? const_cast<liba*> (targets.find<liba> (dir, out, n))
+ ? const_cast<liba*> (ctx.targets.find<liba> (dir, out, n))
: nullptr);
libs* s (phase == run_phase::load
- ? const_cast<libs*> (targets.find<libs> (dir, out, n))
+ ? const_cast<libs*> (ctx.targets.find<libs> (dir, out, n))
: nullptr);
- lib* l (new lib (move (dir), move (out), move (n)));
+ lib* l (new lib (ctx, move (dir), move (out), move (n)));
if (a != nullptr) a->group = l;
if (s != nullptr) s->group = l;