From 4402d5fc6002769210bf06c97f6a3cc97f6e30ee Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 23 Aug 2017 20:07:26 +0200 Subject: Add perform_clean_group(), use instead of ad hoc implementation in cli rule --- build2/cli/rule.cxx | 31 +------------------------------ build2/cli/rule.hxx | 3 --- 2 files changed, 1 insertion(+), 33 deletions(-) (limited to 'build2/cli') diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx index 9e925b3..83774a3 100644 --- a/build2/cli/rule.cxx +++ b/build2/cli/rule.cxx @@ -174,7 +174,7 @@ namespace build2 switch (a) { case perform_update_id: return &perform_update; - case perform_clean_id: return &perform_clean; + case perform_clean_id: return &perform_clean_group; // Standard impl. default: return noop_recipe; // Configure update. } } @@ -304,34 +304,5 @@ namespace build2 return target_state::changed; } - - target_state compile:: - perform_clean (action a, const target& xt) - { - const cli_cxx& t (xt.as ()); - - // The reverse order of update: first delete the files, then clean - // prerequisites. Also update timestamp in case there are operations - // after us that could use the information. - // - // @@ Can't we use clean_extra() for this? - // - bool r (false); - - if (t.i != nullptr) - r = rmfile (t.i->path (), *t.i) || r; - r = rmfile (t.c->path (), *t.c) || r; - r = rmfile (t.h->path (), *t.h) || r; - - t.mtime (timestamp_nonexistent); - - target_state ts (r ? target_state::changed : target_state::unchanged); - - // Clean prerequisites. - // - ts |= reverse_execute_prerequisites (a, t); - - return ts; - } } } diff --git a/build2/cli/rule.hxx b/build2/cli/rule.hxx index 6798a6b..9af1da4 100644 --- a/build2/cli/rule.hxx +++ b/build2/cli/rule.hxx @@ -29,9 +29,6 @@ namespace build2 static target_state perform_update (action, const target&); - - static target_state - perform_clean (action, const target&); }; } } -- cgit v1.1