aboutsummaryrefslogtreecommitdiff
path: root/build/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-03-13 14:34:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-03-13 14:34:24 +0200
commitca41ca8f9a6b21588248e5fee1a013363f3f52a8 (patch)
tree6e791ddac1c6f794273a9701c0c7f1bc9ec3d000 /build/algorithm.ixx
parent0cee33621a93d3348a1bf19a0c94441b717cbcbc (diff)
Add support for "first" and "last" execution modes
Diffstat (limited to 'build/algorithm.ixx')
-rw-r--r--build/algorithm.ixx12
1 files changed, 11 insertions, 1 deletions
diff --git a/build/algorithm.ixx b/build/algorithm.ixx
index 340789e..3bc4632 100644
--- a/build/algorithm.ixx
+++ b/build/algorithm.ixx
@@ -2,6 +2,8 @@
// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
// license : MIT; see accompanying LICENSE file
+#include <build/context>
+
namespace build
{
target&
@@ -37,7 +39,15 @@ namespace build
{
case target_state::unchanged:
case target_state::changed: return t.state;
- default: return execute_impl (a, t);
+ default:
+ {
+ // Handle the "last" execution mode.
+ //
+ if (current_mode == execution_mode::last && t.dependents != 0)
+ return (t.state = target_state::postponed);
+
+ return execute_impl (a, t);
+ }
}
}
}