From d402bc96297c6ed3dd6ee883dcff8cc39bd01030 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Jan 2017 13:50:58 +0200 Subject: Ignore prerequisite mtimes that are not linker inputs This makes sure, for example, that we don't unnecessarily re-link an executable when its testscript prerequisite is changes. --- build2/algorithm.ixx | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) (limited to 'build2/algorithm.ixx') diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx index 3128365..09d522f 100644 --- a/build2/algorithm.ixx +++ b/build2/algorithm.ixx @@ -217,18 +217,46 @@ namespace build2 } } + // If the first argument is NULL, then the result is treated as a boolean + // value. + // + pair + execute_prerequisites (const target_type*, + action, target&, + const timestamp&, const prerequisite_filter&); + + inline pair + execute_prerequisites (action a, target& t, + const timestamp& mt, const prerequisite_filter& pf) + { + auto p (execute_prerequisites (nullptr, a, t, mt, pf)); + return make_pair (p.first != nullptr, p.second); + } + template - inline T* - execute_prerequisites (action a, target& t, const timestamp& mt) + inline pair + execute_prerequisites (action a, target& t, + const timestamp& mt, const prerequisite_filter& pf) + { + auto p (execute_prerequisites (T::static_type, a, t, mt, pf)); + return make_pair (static_cast (p.first), p.second); + } + + inline pair + execute_prerequisites (const target_type& tt, + action a, target& t, + const timestamp& mt, const prerequisite_filter& pf) { - return static_cast (execute_prerequisites (T::static_type, a, t, mt)); + return execute_prerequisites (&tt, a, t, mt, pf); } template - inline T* + inline pair execute_prerequisites (const target_type& tt, - action a, target& t, const timestamp& mt) + action a, target& t, + const timestamp& mt, const prerequisite_filter& pf) { - return static_cast (execute_prerequisites (tt, a, t, mt)); + auto p (execute_prerequisites (tt, a, t, mt, pf)); + return make_pair (static_cast (p.first), p.second); } } -- cgit v1.1