aboutsummaryrefslogtreecommitdiff
path: root/build2/target.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/target.ixx')
-rw-r--r--build2/target.ixx35
1 files changed, 23 insertions, 12 deletions
diff --git a/build2/target.ixx b/build2/target.ixx
index a097e39..b73acd7 100644
--- a/build2/target.ixx
+++ b/build2/target.ixx
@@ -26,18 +26,7 @@ namespace build2
}
inline target_state target::
- atomic_state () const
- {
- switch (task_count)
- {
- case target::count_unexecuted: return target_state::unknown;
- case target::count_executed: return synchronized_state ();
- default: return target_state::busy;
- }
- }
-
- inline target_state target::
- synchronized_state () const
+ state () const
{
// We go an extra step and short-circuit to the target state even if the
// raw state is not group provided the recipe is group_recipe.
@@ -57,6 +46,28 @@ namespace build2
return state_;
}
+ inline target_state target::
+ synchronized_state (bool fail) const
+ {
+ target_state r (state ());
+
+ if (fail && r == target_state::failed)
+ throw failed ();
+
+ return r;
+ }
+
+ inline target_state target::
+ atomic_state (bool fail) const
+ {
+ switch (task_count)
+ {
+ case target::count_unexecuted: return target_state::unknown;
+ case target::count_executed: return synchronized_state (fail);
+ default: return target_state::busy;
+ }
+ }
+
// prerequisite_member
//
inline prerequisite prerequisite_member::