diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-10-19 05:45:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-10-19 05:45:32 +0200 |
commit | 5fec6c87511cacfd9561664a652f8f1b679adcce (patch) | |
tree | f29a4d5bb9a8a23dc2af3749539a491514dc04af /libbuild2/algorithm.ixx | |
parent | b408d19f614b47670cd0a0def501266f0d7689b5 (diff) |
Take 1: match/execute as part of target (dead end)posthoc-take1
Diffstat (limited to 'libbuild2/algorithm.ixx')
-rw-r--r-- | libbuild2/algorithm.ixx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libbuild2/algorithm.ixx b/libbuild2/algorithm.ixx index 417a10e..4983d79 100644 --- a/libbuild2/algorithm.ixx +++ b/libbuild2/algorithm.ixx @@ -424,6 +424,19 @@ 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 (fail && r == target_state::failed) + throw failed (); + + return r; + } + inline pair<bool, target_state> try_match_sync (action a, const target& t, bool fail) { @@ -521,6 +534,7 @@ namespace build2 { t[a].vars.clear (); t.prerequisite_targets[a].clear (); + t.posthoc_targets[a].clear (); t.clear_data (a); } @@ -960,8 +974,9 @@ namespace build2 p.first, static_cast<const T&> (p.second)); } + template <typename T> inline target_state - execute_members (action a, const target& t, const target* ts[], size_t n) + execute_members (action a, const target& t, T ts[], size_t n) { return t.ctx.current_mode == execution_mode::first ? straight_execute_members (a, t, ts, n, 0) |