aboutsummaryrefslogtreecommitdiff
path: root/build/algorithm
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
parentbb4f9e6498ba715911f83e0dc221a5b1b86baf51 (diff)
Add support for generated test input/output
Diffstat (limited to 'build/algorithm')
-rw-r--r--build/algorithm18
1 files changed, 18 insertions, 0 deletions
diff --git a/build/algorithm b/build/algorithm
index d01614c..3b09d9c 100644
--- a/build/algorithm
+++ b/build/algorithm
@@ -6,6 +6,7 @@
#define BUILD_ALGORITHM
#include <string>
+#include <utility> // pair
#include <build/types>
#include <build/target>
@@ -68,6 +69,14 @@ namespace build
void
match (action, target&);
+ // Match a "delegate rule" from withing another rules' apply()
+ // function. Return recipe and recipe action (if any). Note
+ // that unlike match(), this call doesn't increment the
+ // dependents count. See also execute_delegate().
+ //
+ std::pair<recipe, action>
+ match_delegate (action, target&);
+
// The standard prerequisite search and match implementations. They call
// search_and_match_*() versions below passing non-empty directory for
// the clean operation.
@@ -116,6 +125,15 @@ namespace build
target_state
execute (action, target&);
+ // Execute the recipe obtained with match_delegate(). Note that
+ // the target's state is neither checked nor updated by this
+ // function. In other words, the appropriate usage is to call
+ // this function from another recipe and to factor the obtained
+ // state into the one returned.
+ //
+ target_state
+ execute_delegate (const recipe&, action, target&);
+
// A special version of the above that should be used for "direct"
// and "now" execution, that is, side-stepping the normal target-
// prerequisite relationship (so no dependents count is decremented)