From ea4ee77fe69d802056bd0dd80b1e63cab2dad412 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 10 Jul 2017 20:06:26 -0600 Subject: [PATCH] Move calling target action to an action method to allow override. This moves the calling of the target action rule to an "execute" method in the action class. This allows one to create a custom generator that makes corresponding action classes. That in turn can override the "execute" to do other work on the engine targets directly. --- src/build/virtual-target.jam | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/build/virtual-target.jam b/src/build/virtual-target.jam index 264616db6..2d139bd7f 100644 --- a/src/build/virtual-target.jam +++ b/src/build/virtual-target.jam @@ -794,7 +794,9 @@ class action # rules. .action on $(actual-targets) = $(__name__) ; - indirect.call $(self.action-name) $(actual-targets) + #indirect.call $(self.action-name) $(actual-targets) + # : $(self.actual-sources) : [ $(properties).raw ] ; + execute $(self.action-name) $(actual-targets) : $(self.actual-sources) : [ $(properties).raw ] ; # Since we set up the creating action here, we set up the action for @@ -865,6 +867,19 @@ class action { return $(property-set) ; } + + # Execute the action rule on the given targets, sources, and properties. + # Since this does the final call to the engine action rule this takes + # engine level targets and raw properties. One could override this, for + # example, to set additional variables on hte target that might be + # difficult to determine just using toolset flags. + # Note, you must call this base rule when overriding as otherwise the + # actions will not execute and the engine will not run commands. + # + rule execute ( action-name targets + : sources * : properties * ) + { + indirect.call $(action-name) $(targets) : $(sources) : $(properties) ; + } }