From ca41ca8f9a6b21588248e5fee1a013363f3f52a8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Mar 2015 14:34:24 +0200 Subject: Add support for "first" and "last" execution modes --- build/algorithm.ixx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'build/algorithm.ixx') 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 + 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); + } } } } -- cgit v1.1