Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-04-05 08:12:15


On Monday 04 April 2005 22:43, Shawn Halpenny wrote:
> I'm just starting to explore Boost.Build for a project and discovered
> that no targets seem to depend on the Jamfiles themselves (neither
> those of my projects nor those of Boost.Build).

Right. It was requested once, IIRC, but overall there was little demand.

> To me, this is a requirement in any build environment where there is a
> common configuration. At the very least, it should be an option. If
> I build project A one day, and then someone else updates the
> global/common Jamfiles (or even changes an <include> in some
> subproject's jamfile), I'd like a rebuild of the affected targets
> (i.e. all of them if it was a common jamfile) to occur the next time I
> build that project. Even if it's a complete rebuild from scratch is
> better than silently implying that nothing needs to rebuild.

Guess that's your choice, and allowing you to have this behaviour is desired.

> Is this feature already present, just not enabled? I don't mind
> trying to work on it (I'm not that familiar with Jam yet) but am not
> sure where to begin.

I was able to obtain the behaviour you want by adding the following code to
file-target.actualize-location (virtual-target.jam):

DEPENDS $(target) : [ modules.binding
[ $(self.project).project-module ] ] ;

(inside the if $(self.action) branch). I get this:

...found 10 targets...
$ touch Jamroot
$ bjam
...found 10 targets...
...updating 2 targets...
gcc.compile.c++ bin/gcc/debug/hello.o
gcc.link bin/gcc/debug/hello

The patch is attached.

However, it's a question if it should be enabled by default, or via some
explicit options. I'm sure some of your users will disagree to have
everything rebuilt on every Jamfile change.

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2
 --Boundary-00=_w6oUCEThhqentP4 Content-Type: text/x-diff;
charset="iso-8859-1";
name="virtual-target.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="virtual-target.diff"
Index: virtual-target.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/build/virtual-target.jam,v
retrieving revision 1.97
diff -u -r1.97 virtual-target.jam
--- virtual-target.jam	9 Mar 2005 09:08:24 -0000	1.97
+++ virtual-target.jam	5 Apr 2005 13:10:36 -0000
@@ -522,6 +522,9 @@
common.MkDir $(d) ;
} 
+ 
+ DEPENDS $(target) : [ modules.binding 
+ [ $(self.project).project-module ] ] ;
}
else
{
 --Boundary-00=_w6oUCEThhqentP4-- 

Boost-Build 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