From 4be404cd8b7f4c7b450364defea92cd02e9b7a62 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 21 Jul 2015 15:51:54 +0200 Subject: Improve nested operations support The idea is this: we need to be able to override "conditional, inner for outer" recipes with the "unconditional inner" ones. Here is the concrete scenario: we have {update, test} action and the lib{} target that is both mentioned as a prerequisite of ./ and exe{}, which is a test. At first, we want to ignore lib{} when reached as a prerequisite of ./. But then we get to it via exe{} (which is a test and thus should be updated). At this point we should override the recipe for lib{} with the one that would update it rather than ignore. --- build/algorithm.ixx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'build/algorithm.ixx') diff --git a/build/algorithm.ixx b/build/algorithm.ixx index a1e2129..4581d5b 100644 --- a/build/algorithm.ixx +++ b/build/algorithm.ixx @@ -2,8 +2,6 @@ // copyright : Copyright (c) 2014-2015 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file -#include // pair - #include #include #include @@ -50,7 +48,15 @@ namespace build return static_cast (search (T::static_type, dir, name, ext, scope)); } - std::pair + + struct match_result_impl + { + action ra; // Action to set recipe, not to pass to apply(). + const rule* ru; + match_result mr; + }; + + match_result_impl match_impl (action, target&, bool apply); inline void -- cgit v1.1