From 040ebadfa9e606b56005b80571e7fc714a3f1f2c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 14 Aug 2015 16:58:20 +0200 Subject: Don't short-cut to group_state if recipe is group_recipe This way we mess up the dependents count. --- build/target | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'build/target') diff --git a/build/target b/build/target index 35b013a..9e15550 100644 --- a/build/target +++ b/build/target @@ -81,12 +81,12 @@ namespace build using recipe_function = target_state (action, target&); using recipe = std::function; - // Commonly-used recipes. The default recipe executes the action - // on all the prerequisites in a loop, skipping ignored. Specially, + // Commonly-used recipes. The default recipe executes the action on + // all the prerequisites in a loop, skipping ignored. Specifically, // for actions with the "first" execution mode, it calls // execute_prerequisites() while for those with the "last" mode -- // reverse_execute_prerequisites(); see , - // for details. The group recipe calls the group's + // for details. The group recipe call's the group's // recipe. // extern const recipe empty_recipe; @@ -780,12 +780,10 @@ namespace build public: using target::target; - // Target mtime is only available after a rule has been matched - // (because this is when we know if we should get our mtime from - // the group and where the path which we need to load mtime is - // normally assigned). The mtime is also unavailable while the - // execution of the target is postponed (because we temporarily - // loose our group state). + // Generally, modification time for a target can only be queried + // after a rule has been matched since that's where the path is + // normally gets assigned. Normally, however, it would make sense + // to first execute the rule to get the "updated" timestamp. // // The rule for groups that utilize the group state is as follows: // if it has any members that are mtime_targets, then the group @@ -794,8 +792,6 @@ namespace build timestamp mtime () const { - assert (raw_state != target_state::postponed); - const mtime_target* t (raw_state == target_state::group ? static_cast (group) : this); -- cgit v1.1