From 4f5b6cb7ed4e05e98cce7e692462f49e24b7a39a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Aug 2019 14:38:57 +0200 Subject: Targets, scopes, vars --- build2/bin/target.cxx | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'build2/bin/target.cxx') 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 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 (dir, out, n)); + const G* g (ctx.targets.find (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 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 (targets.find (dir, out, n)) + ? const_cast (ctx.targets.find (dir, out, n)) : nullptr); A* a (phase == run_phase::load - ? const_cast (targets.find (dir, out, n)) + ? const_cast (ctx.targets.find (dir, out, n)) : nullptr); S* s (phase == run_phase::load - ? const_cast (targets.find (dir, out, n)) + ? const_cast (ctx.targets.find (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 (targets.find (dir, out, n)) + ? const_cast (ctx.targets.find (dir, out, n)) : nullptr); libus* s (phase == run_phase::load - ? const_cast (targets.find (dir, out, n)) + ? const_cast (ctx.targets.find (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 (targets.find (dir, out, n)) + ? const_cast (ctx.targets.find (dir, out, n)) : nullptr); libs* s (phase == run_phase::load - ? const_cast (targets.find (dir, out, n)) + ? const_cast (ctx.targets.find (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; -- cgit v1.1