diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-18 13:50:58 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-18 13:50:58 +0200 |
commit | d402bc96297c6ed3dd6ee883dcff8cc39bd01030 (patch) | |
tree | 634d397f48022935926e26123c13ab8adad6796e /build2/algorithm.ixx | |
parent | 34be21a72a396240642acf3050eead875d3ed4b4 (diff) |
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.
Diffstat (limited to 'build2/algorithm.ixx')
-rw-r--r-- | build2/algorithm.ixx | 40 |
1 files changed, 34 insertions, 6 deletions
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<target*, target_state> + execute_prerequisites (const target_type*, + action, target&, + const timestamp&, const prerequisite_filter&); + + inline pair<bool, target_state> + 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 <typename T> - inline T* - execute_prerequisites (action a, target& t, const timestamp& mt) + inline pair<T*, target_state> + 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<T*> (p.first), p.second); + } + + inline pair<target*, target_state> + execute_prerequisites (const target_type& tt, + action a, target& t, + const timestamp& mt, const prerequisite_filter& pf) { - return static_cast<T*> (execute_prerequisites (T::static_type, a, t, mt)); + return execute_prerequisites (&tt, a, t, mt, pf); } template <typename T> - inline T* + inline pair<T*, target_state> 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<T*> (execute_prerequisites (tt, a, t, mt)); + auto p (execute_prerequisites (tt, a, t, mt, pf)); + return make_pair (static_cast<T*> (p.first), p.second); } } |