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/cli/init.cxx | 2 +- build2/cli/rule.cxx | 4 ++-- build2/cli/target.cxx | 11 ++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'build2/cli') diff --git a/build2/cli/init.cxx b/build2/cli/init.cxx index 6d20aa0..2e553f7 100644 --- a/build2/cli/init.cxx +++ b/build2/cli/init.cxx @@ -43,7 +43,7 @@ namespace build2 // if (first) { - auto& v (var_pool.rw (rs)); + auto& v (rs.ctx.var_pool.rw (rs)); // Note: some overridable, some not. // diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx index f6bebee..f6c0763 100644 --- a/build2/cli/rule.cxx +++ b/build2/cli/rule.cxx @@ -112,7 +112,7 @@ namespace build2 // Check if there is a corresponding cli.cxx{} group. // - const cli_cxx* g (targets.find (t.dir, t.out, t.name)); + const cli_cxx* g (t.ctx.targets.find (t.dir, t.out, t.name)); // If not or if it has no prerequisites (happens when we use it to // set cli.options) and this target has a cli{} prerequisite, then @@ -124,7 +124,7 @@ namespace build2 prerequisite_members (a, t))) { if (g == nullptr) - g = &targets.insert (t.dir, t.out, t.name, trace); + g = &t.ctx.targets.insert (t.dir, t.out, t.name, trace); g->prerequisites (prerequisites {p->as_prerequisite ()}); } diff --git a/build2/cli/target.cxx b/build2/cli/target.cxx index 096295a..caa12b0 100644 --- a/build2/cli/target.cxx +++ b/build2/cli/target.cxx @@ -45,7 +45,8 @@ namespace build2 } static target* - cli_cxx_factory (const target_type&, dir_path d, dir_path o, string n) + cli_cxx_factory (context& ctx, + const target_type&, dir_path d, dir_path o, string n) { tracer trace ("cli::cli_cxx_factory"); @@ -55,11 +56,11 @@ namespace build2 // // Also required for the src-out remapping logic. // - targets.insert (d, o, n, trace); - targets.insert (d, o, n, trace); - targets.insert (d, o, n, trace); + ctx.targets.insert (d, o, n, trace); + ctx.targets.insert (d, o, n, trace); + ctx.targets.insert (d, o, n, trace); - return new cli_cxx (move (d), move (o), move (n)); + return new cli_cxx (ctx, move (d), move (o), move (n)); } const target_type cli_cxx::static_type -- cgit v1.1