From 630dc4ccf3207f7cdd5b410582e1e572081b80e8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 16 Dec 2017 09:43:38 +0200 Subject: Add support for structured result output (--structured-result) --- build2/dist/operation.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'build2/dist/operation.cxx') diff --git a/build2/dist/operation.cxx b/build2/dist/operation.cxx index d63e483..7539fc1 100644 --- a/build2/dist/operation.cxx +++ b/build2/dist/operation.cxx @@ -60,7 +60,7 @@ namespace build2 // For now we assume all the targets are from the same project. // - const target& t (*static_cast (ts[0])); + const target& t (ts[0].as_target ()); const scope* rs (t.base_scope ().root_scope ()); if (rs == nullptr) @@ -99,9 +99,9 @@ namespace build2 // Verify all the targets are from the same project. // - for (const void* v: ts) + for (const action_target& at: ts) { - const target& t (*static_cast (v)); + const target& t (at.as_target ()); if (rs != t.base_scope ().root_scope ()) fail << "target " << t << " is from a different project" << @@ -252,6 +252,8 @@ namespace build2 // things down while this little cheat seems harmless (i.e., assume // the dist mete-opreation is "compatible" with perform). // + // Note also that we don't do any structured result printing. + // size_t on (current_on); set_current_mif (mo_perform); current_on = on + 1; @@ -264,7 +266,7 @@ namespace build2 action a (perform_id, update_id); mo_perform.match (params, a, files); - mo_perform.execute (params, a, files, true); // Run quiet. + mo_perform.execute (params, a, files, true /* quiet */); if (mo_perform.operation_post != nullptr) mo_perform.operation_post (params, update_id); @@ -288,9 +290,9 @@ namespace build2 // module& mod (*rs->modules.lookup (module::name)); - for (const void* v: files) + for (const action_target& at: files) { - const file& t (*static_cast (v)); + const file& t (*at.as_target ().is_a ()); // Figure out where this file is inside the target directory. // -- cgit v1.1