diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-22 14:38:57 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-23 18:14:07 +0200 |
commit | 5035f4ef68922ac758b1e4734e67d73c9228010b (patch) | |
tree | 271fdd5b1d6e995a058d97aacb3ac90a538d9ff1 /libbuild2/diagnostics.cxx | |
parent | 8793941652d6aa1c3d02b2f87f691e6d06254b7d (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/diagnostics.cxx')
-rw-r--r-- | libbuild2/diagnostics.cxx | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/libbuild2/diagnostics.cxx b/libbuild2/diagnostics.cxx index 3375e00..71f3d48 100644 --- a/libbuild2/diagnostics.cxx +++ b/libbuild2/diagnostics.cxx @@ -141,14 +141,14 @@ namespace build2 const fail_mark fail ("error"); const fail_end endf; - // diag_do(), etc. + // diag_do(), etc. // string - diag_do (const action&) + diag_do (context& ctx, const action&) { - const meta_operation_info& m (*current_mif); - const operation_info& io (*current_inner_oif); - const operation_info* oo (current_outer_oif); + const meta_operation_info& m (*ctx.current_mif); + const operation_info& io (*ctx.current_inner_oif); + const operation_info* oo (ctx.current_outer_oif); string r; @@ -181,15 +181,15 @@ namespace build2 void diag_do (ostream& os, const action& a, const target& t) { - os << diag_do (a) << ' ' << t; + os << diag_do (t.ctx, a) << ' ' << t; } string - diag_doing (const action&) + diag_doing (context& ctx, const action&) { - const meta_operation_info& m (*current_mif); - const operation_info& io (*current_inner_oif); - const operation_info* oo (current_outer_oif); + const meta_operation_info& m (*ctx.current_mif); + const operation_info& io (*ctx.current_inner_oif); + const operation_info* oo (ctx.current_outer_oif); string r; @@ -218,15 +218,15 @@ namespace build2 void diag_doing (ostream& os, const action& a, const target& t) { - os << diag_doing (a) << ' ' << t; + os << diag_doing (t.ctx, a) << ' ' << t; } string - diag_did (const action&) + diag_did (context& ctx, const action&) { - const meta_operation_info& m (*current_mif); - const operation_info& io (*current_inner_oif); - const operation_info* oo (current_outer_oif); + const meta_operation_info& m (*ctx.current_mif); + const operation_info& io (*ctx.current_inner_oif); + const operation_info* oo (ctx.current_outer_oif); string r; @@ -259,15 +259,15 @@ namespace build2 void diag_did (ostream& os, const action& a, const target& t) { - os << diag_did (a) << ' ' << t; + os << diag_did (t.ctx, a) << ' ' << t; } void diag_done (ostream& os, const action&, const target& t) { - const meta_operation_info& m (*current_mif); - const operation_info& io (*current_inner_oif); - const operation_info* oo (current_outer_oif); + const meta_operation_info& m (*t.ctx.current_mif); + const operation_info& io (*t.ctx.current_inner_oif); + const operation_info* oo (t.ctx.current_outer_oif); // perform(update(x)) -> "x is up to date" // configure(update(x)) -> "updating x is configured" |