aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-10-04 12:43:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-10-04 12:43:06 +0200
commit0a1f06d11edb1d48fd8c848348031bf08652a580 (patch)
tree2ba76039f01c89161629867355deaa8780cebd8f /libbuild2/algorithm.ixx
parentcbf3f2d5b3787c8281f3227b65ec30170fcd3379 (diff)
Add match_direct_complete() to support async direct matches
Diffstat (limited to 'libbuild2/algorithm.ixx')
-rw-r--r--libbuild2/algorithm.ixx32
1 files changed, 19 insertions, 13 deletions
diff --git a/libbuild2/algorithm.ixx b/libbuild2/algorithm.ixx
index 9f1b70f..6d83984 100644
--- a/libbuild2/algorithm.ixx
+++ b/libbuild2/algorithm.ixx
@@ -427,19 +427,6 @@ namespace build2
return r;
}
- inline target_state
- match_direct_sync (action a, const target& t, bool fail)
- {
- assert (t.ctx.phase == run_phase::match);
-
- target_state r (match_impl (a, t, 0, nullptr).second);
-
- if (r == target_state::failed && fail)
- throw failed ();
-
- return r;
- }
-
inline pair<bool, target_state>
try_match_sync (action a, const target& t, bool fail)
{
@@ -530,6 +517,25 @@ namespace build2
return match_sync (a, t, um);
}
+ inline target_state
+ match_direct_sync (action a, const target& t, bool fail)
+ {
+ assert (t.ctx.phase == run_phase::match);
+
+ target_state r (match_impl (a, t, 0, nullptr).second);
+
+ if (r == target_state::failed && fail)
+ throw failed ();
+
+ return r;
+ }
+
+ inline target_state
+ match_direct_complete (action a, const target& t, bool fail)
+ {
+ return match_direct_sync (a, t, fail);
+ }
+
// Clear rule match-specific target data.
//
inline void