From 934f2a9a90c5cad3cdc8a66b50c17827a3ddbcee Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 20 Jan 2018 13:46:11 +0200 Subject: Get rid of action rule override semantics Instead we now have two more or less separate match states for outer and inner parts of an action. --- build2/rule.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'build2/rule.cxx') diff --git a/build2/rule.cxx b/build2/rule.cxx index 2ed0bbd..ef1d3a4 100644 --- a/build2/rule.cxx +++ b/build2/rule.cxx @@ -25,7 +25,7 @@ namespace build2 // that normal implementations should follow. So you probably shouldn't // use it as a guide to implement your own, normal, rules. // - match_result file_rule:: + bool file_rule:: match (action a, target& t, const string&) const { tracer trace ("file_rule::match"); @@ -131,7 +131,7 @@ namespace build2 // alias_rule // - match_result alias_rule:: + bool alias_rule:: match (action, target&, const string&) const { return true; @@ -153,7 +153,7 @@ namespace build2 // fsdir_rule // - match_result fsdir_rule:: + bool fsdir_rule:: match (action, target&, const string&) const { return true; @@ -220,7 +220,7 @@ namespace build2 // First update prerequisites (e.g. create parent directories) then create // this directory. // - if (!t.prerequisite_targets.empty ()) + if (!t.prerequisite_targets[a].empty ()) ts = straight_execute_prerequisites (a, t); // The same code as in perform_update_direct() below. @@ -243,9 +243,9 @@ namespace build2 { // First create the parent directory. If present, it is always first. // - const target* p (t.prerequisite_targets.empty () + const target* p (t.prerequisite_targets[a].empty () ? nullptr - : t.prerequisite_targets[0]); + : t.prerequisite_targets[a][0]); if (p != nullptr && p->is_a ()) perform_update_direct (a, *p); @@ -272,7 +272,7 @@ namespace build2 ? target_state::changed : target_state::unchanged); - if (!t.prerequisite_targets.empty ()) + if (!t.prerequisite_targets[a].empty ()) ts |= reverse_execute_prerequisites (a, t); return ts; -- cgit v1.1