From c1dc06dfd1d329f8c6499dbe2166725ab9c35e17 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Jul 2018 15:31:13 +0200 Subject: Implement bash module --- build2/algorithm.cxx | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'build2/algorithm.cxx') diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx index c46e878..550a491 100644 --- a/build2/algorithm.cxx +++ b/build2/algorithm.cxx @@ -654,9 +654,12 @@ namespace build2 match_impl (l, true /* step */, true /* try_match */); } - template + template static void - match_prerequisite_range (action a, target& t, R&& r, const scope* s) + match_prerequisite_range (action a, target& t, + R&& r, + const S& ms, + const scope* s) { auto& pts (t.prerequisite_targets[a]); @@ -675,13 +678,15 @@ namespace build2 if (!pi) continue; - const target& pt (search (t, p)); + prerequisite_target pt (ms + ? ms (a, t, p, pi) + : prerequisite_target (&search (t, p), pi)); - if (s != nullptr && !pt.in (*s)) + if (pt.target == nullptr || (s != nullptr && !pt.target->in (*s))) continue; - match_async (a, pt, target::count_busy (), t[a].task_count); - pts.push_back (prerequisite_target (&pt, pi)); + match_async (a, *pt.target, target::count_busy (), t[a].task_count); + pts.push_back (move (pt)); } wg.wait (); @@ -696,15 +701,19 @@ namespace build2 } void - match_prerequisites (action a, target& t, const scope* s) + match_prerequisites (action a, target& t, + const match_search& ms, + const scope* s) { - match_prerequisite_range (a, t, group_prerequisites (t), s); + match_prerequisite_range (a, t, group_prerequisites (t), ms, s); } void - match_prerequisite_members (action a, target& t, const scope* s) + match_prerequisite_members (action a, target& t, + const match_search_member& msm, + const scope* s) { - match_prerequisite_range (a, t, group_prerequisite_members (a, t), s); + match_prerequisite_range (a, t, group_prerequisite_members (a, t), msm, s); } template @@ -1715,7 +1724,7 @@ namespace build2 pair, const target*> execute_prerequisites (const target_type* tt, action a, const target& t, - const timestamp& mt, const prerequisite_filter& pf, + const timestamp& mt, const execute_filter& ef, size_t n) { assert (current_mode == execution_mode::first); @@ -1770,7 +1779,7 @@ namespace build2 // Should we compare the timestamp to this target's? // - if (!e && (!pf || pf (pt, i))) + if (!e && (!ef || ef (pt, i))) { // If this is an mtime-based target, then compare timestamps. // -- cgit v1.1