From 183329b89ddf810e2df5c250ae5b97d8ebcbba74 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 3 Mar 2017 14:33:54 +0200 Subject: Fix cli distribution via group --- build2/cli/init.cxx | 28 ++++++++++++++-------------- build2/cli/target.cxx | 7 +++---- 2 files changed, 17 insertions(+), 18 deletions(-) (limited to 'build2/cli') diff --git a/build2/cli/init.cxx b/build2/cli/init.cxx index 1cf248d..590d434 100644 --- a/build2/cli/init.cxx +++ b/build2/cli/init.cxx @@ -300,23 +300,23 @@ namespace build2 { auto& r (bs.rules); - r.insert (perform_update_id, "cli.compile", compile_); - r.insert (perform_clean_id, "cli.compile", compile_); - - r.insert (perform_update_id, "cli.compile", compile_); - r.insert (perform_clean_id, "cli.compile", compile_); - - r.insert (perform_update_id, "cli.compile", compile_); - r.insert (perform_clean_id, "cli.compile", compile_); + auto reg = [&r] (meta_operation_id mid, operation_id oid) + { + r.insert (mid, oid, "cli.compile", compile_); + r.insert (mid, oid, "cli.compile", compile_); + r.insert (mid, oid, "cli.compile", compile_); + r.insert (mid, oid, "cli.compile", compile_); + }; - r.insert (perform_update_id, "cli.compile", compile_); - r.insert (perform_clean_id, "cli.compile", compile_); + reg (perform_id, update_id); + reg (perform_id, clean_id); - // Other rules (e.g., cxx::compile) may need to have the group - // members resolved. Looks like a general pattern: groups should - // resolve on configure(update). + // Other rules (e.g., cxx::compile) may need to have the group members + // resolved/linked up. Looks like a general pattern: groups should + // resolve on *(update). // - r.insert (configure_update_id, "cli.compile", compile_); + reg (configure_id, update_id); + reg (dist_id, update_id); } return true; diff --git a/build2/cli/target.cxx b/build2/cli/target.cxx index 51f58aa..015c034 100644 --- a/build2/cli/target.cxx +++ b/build2/cli/target.cxx @@ -50,10 +50,9 @@ namespace build2 { tracer trace ("cli::cli_cxx_factory"); - // Pre-enter (potential) members as targets. The main purpose - // of doing this is to avoid searching for existing files in - // src_base if the buildfile mentions some of them explicitly - // as prerequisites. + // Pre-enter (potential) members as targets. The main purpose of doing + // this is to avoid searching for existing files in src_base if the + // buildfile mentions some of them explicitly as prerequisites. // targets.insert (d, o, n, trace); targets.insert (d, o, n, trace); -- cgit v1.1