aboutsummaryrefslogtreecommitdiff
path: root/build/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-24 16:39:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-24 16:39:55 +0200
commit1d6e68fda762535fa8508f94ca254a79f293edb2 (patch)
tree7b97edd9f1786cd610c1f41e720d2b105dd87cbc /build/algorithm.ixx
parentbb4f9e6498ba715911f83e0dc221a5b1b86baf51 (diff)
Add support for generated test input/output
Diffstat (limited to 'build/algorithm.ixx')
-rw-r--r--build/algorithm.ixx27
1 files changed, 18 insertions, 9 deletions
diff --git a/build/algorithm.ixx b/build/algorithm.ixx
index 7849713..26761bf 100644
--- a/build/algorithm.ixx
+++ b/build/algorithm.ixx
@@ -2,6 +2,8 @@
// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
// license : MIT; see accompanying LICENSE file
+#include <utility> // pair
+
#include <build/rule>
#include <build/prerequisite>
#include <build/context>
@@ -48,15 +50,7 @@ namespace build
return static_cast<T&> (search (T::static_type, dir, name, ext, scope));
}
-
- struct match_result_impl
- {
- action ra; // Action to set recipe, not to pass to apply().
- const rule* ru;
- match_result mr;
- };
-
- match_result_impl
+ std::pair<const rule*, match_result>
match_impl (action, target&, bool apply);
inline void
@@ -68,6 +62,15 @@ namespace build
t.dependents++;
}
+ inline std::pair<recipe, action>
+ match_delegate (action a, target& t)
+ {
+ auto rp (match_impl (a, t, false));
+ const match_result& mr (rp.second);
+ return std::make_pair (rp.first->apply (mr.recipe_action, t, mr),
+ mr.recipe_action);
+ }
+
group_view
resolve_group_members_impl (action, target&);
@@ -153,6 +156,12 @@ namespace build
}
inline target_state
+ execute_delegate (const recipe& r, action a, target& t)
+ {
+ return r (a, t);
+ }
+
+ inline target_state
execute_direct (action a, target& t)
{
switch (target_state ts = t.state ())