diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-08-23 20:07:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-08-23 20:07:26 +0200 |
commit | 4402d5fc6002769210bf06c97f6a3cc97f6e30ee (patch) | |
tree | b1cf3e59a6f1a21a56d5a9878cb65e9bef619653 /build2/cli/rule.cxx | |
parent | 8f9ace8452b04bb8de2dec3af96ce241400e3e96 (diff) |
Add perform_clean_group(), use instead of ad hoc implementation in cli rule
Diffstat (limited to 'build2/cli/rule.cxx')
-rw-r--r-- | build2/cli/rule.cxx | 31 |
1 files changed, 1 insertions, 30 deletions
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<cli_cxx> ()); - - // 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; - } } } |