|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-12-27 10:18:39
On Monday 27 December 2004 17:37, alex76vs wrote:
> > exe my_exe : a.cpp b.cpp : <implicit-dependency>my_header ;
> >
> > The "implicit-dependency" feature says that some of my_exe sources
>
> include
>
> > targets produced by my_header. V2 will figure out which one, and
>
> dependency
>
> > should be correct.
>
> This in an absolutely fantastic piece of functionality. How does it
> figure out that an additional "-I" should be added to locate a
> generated ".hpp" in the build output directory? This is more than I
> could expect!
It simply adds all target paths of main target referred by
<implicit-dependency>. After that, bjam, during header scan, recognised that
included target is the same that the generated one.
> Now I am passing some extra arguments to the generator in the
> following manner:
> hpp b : b.h : <normalize-options>"abc def" ;
> In order to extract the arguments I use a loop:
> rule normalize ( target : source : options * )
> {
> local args ;
> for local opt in $(options)
> {
> if $(opt:G) = <normalize-options>
> {
> args += $(opt:G="") ;
> }
> }
> ARGS on $(target) = $(args) ;
> }
> I suspect that there should be some utility class/function in the
> build system that would collapse all this into a single line. Is there
> anything?
Yes.
flags your.generator.rule.name ARGS <normalize-options> ;
should do the trick. See
http://boost.org/boost-build2/doc/html/bbv2/extending/features.html
- Volodya
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