aboutsummaryrefslogtreecommitdiff
path: root/build2/target.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/target.ixx')
-rw-r--r--build2/target.ixx21
1 files changed, 14 insertions, 7 deletions
diff --git a/build2/target.ixx b/build2/target.ixx
index 0be5aed..eb7dbaa 100644
--- a/build2/target.ixx
+++ b/build2/target.ixx
@@ -129,15 +129,22 @@ namespace build2
{
recipe_ = move (r);
- // If this is a noop recipe, then mark the target unchanged to allow for
- // some optimizations.
+ // Do not clear the failed target state in case of an override (and we
+ // should never see the failed state from the previous operation since we
+ // should abort the execution in this case).
//
- state_ = target_state::unknown;
-
- if (recipe_function** f = recipe_.target<recipe_function*> ())
+ if (state_ != target_state::failed)
{
- if (*f == &noop_action)
- state_ = target_state::unchanged;
+ // If this is a noop recipe, then mark the target unchanged to allow for
+ // some optimizations.
+ //
+ state_ = target_state::unknown;
+
+ if (recipe_function** f = recipe_.target<recipe_function*> ())
+ {
+ if (*f == &noop_action)
+ state_ = target_state::unchanged;
+ }
}
}