Boost logo

Boost-Commit :

From: grafikrobot_at_[hidden]
Date: 2007-09-17 04:32:24


Author: grafik
Date: 2007-09-17 04:32:24 EDT (Mon, 17 Sep 2007)
New Revision: 39341
URL: http://svn.boost.org/trac/boost/changeset/39341

Log:
Add internal dependencies for multi-file generating actions to indicate that the targets all only appear when the first target appears. (fixes ticket #431)
Text files modified:
   trunk/tools/jam/src/compile.c | 18 ++++++++++++++++++
   trunk/tools/jam/test/parallel_multifile_actions.jam | 7 +++++--
   2 files changed, 23 insertions(+), 2 deletions(-)

Modified: trunk/tools/jam/src/compile.c
==============================================================================
--- trunk/tools/jam/src/compile.c (original)
+++ trunk/tools/jam/src/compile.c 2007-09-17 04:32:24 EDT (Mon, 17 Sep 2007)
@@ -1012,6 +1012,24 @@
         action->rule = rule;
         action->targets = targetlist( (TARGETS *)0, lol_get( frame->args, 0 ) );
         action->sources = targetlist( (TARGETS *)0, lol_get( frame->args, 1 ) );
+
+ /* Make targets[1,N-1] depend on targets[0], to describe the multply
+ generated targets for the rule. Do it with includes, to reflect
+ non-build dependency. */
+ {
+ TARGET * t0 = action->targets->target;
+ for ( t = action->targets->next; t; t = t->next )
+ {
+ TARGET * tn = t->target;
+ if ( !tn->includes )
+ {
+ tn->includes = copytarget( tn );
+ tn->includes->original_target = tn;
+ }
+ tn = tn->includes;
+ tn->depends = targetentry( tn->depends, t0 );
+ }
+ }
 
         /* Append this action to the actions of each target */
 

Modified: trunk/tools/jam/test/parallel_multifile_actions.jam
==============================================================================
--- trunk/tools/jam/test/parallel_multifile_actions.jam (original)
+++ trunk/tools/jam/test/parallel_multifile_actions.jam 2007-09-17 04:32:24 EDT (Mon, 17 Sep 2007)
@@ -5,7 +5,7 @@
 if ! $(BJAM_SUBTEST)
 {
     ECHO --- Testing -jN parallel execution of multi-file actions... ;
- assert "...found 5 targets...
+ assert "...found 6 targets...
 ...updating 4 targets...
 .gen. g1.generated
 001
@@ -37,7 +37,10 @@
     .use.1 u1.user : g1.generated ;
     .use.2 u2.user : g2.generated ;
 
+ NOTFILE root ;
+ DEPENDS g1.generated g2.generated : root ;
     DEPENDS all : u1.user u2.user ;
     #~ Work around... Remove when fixed...
- DEPENDS g2.generated : g1.generated ;
+ #~ DEPENDS g2.generated : g1.generated ;
+ #~ INCLUDES g2.generated : g1.generated ;
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk