aboutsummaryrefslogtreecommitdiff
path: root/build/algorithm.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'build/algorithm.ixx')
-rw-r--r--build/algorithm.ixx27
1 files changed, 27 insertions, 0 deletions
diff --git a/build/algorithm.ixx b/build/algorithm.ixx
index e33566b..340789e 100644
--- a/build/algorithm.ixx
+++ b/build/algorithm.ixx
@@ -4,6 +4,15 @@
namespace build
{
+ target&
+ search_impl (prerequisite&);
+
+ inline target&
+ search (prerequisite& p)
+ {
+ return p.target != nullptr ? *p.target : search_impl (p);
+ }
+
void
match_impl (action, target&);
@@ -12,5 +21,23 @@ namespace build
{
if (!t.recipe (a))
match_impl (a, t);
+
+ t.dependents++;
+ }
+
+ target_state
+ execute_impl (action, target&);
+
+ inline target_state
+ execute (action a, target& t)
+ {
+ t.dependents--;
+
+ switch (t.state)
+ {
+ case target_state::unchanged:
+ case target_state::changed: return t.state;
+ default: return execute_impl (a, t);
+ }
}
}