Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2008-08-19 06:06:03

On Tuesday 19 August 2008 13:53:18 Sven Van Echelpoel wrote:
> Hi,
> thanks for the quick response!
> On Tue, 2008-08-19 at 12:56 +0400, Vladimir Prus wrote:
> > Sven Van Echelpoel wrote:
> >
> > > Hi,
> > >
> > > I'm creating a generator for ANTLR using Boost.Build v2. By following
> > > one of the samples I got everything to work, i.e. Boost.Build picks ups
> > > any .g (grammar) file in the sources and generates the appropriate .cpp
> > > and .h files. All I need right now is a way for adding the path to the
> > > output directory to the requirements of target that has this .g file as
> > > a source. How can I add an <include> feature from within the generator
> > > rule?
> >
> > Do you actually need to? Usually, Boost.Build will automatically add include
> > paths for targets of type H that are produced inside the same main target.
> > Is this not happening?
> Err.. yes this is happening, but what I meant to say was, I need to add
> it to the usage requirements. The parser and lexer get built into a
> static library, which I then want to use to test the parser. Both the
> generated parser and lexer compile fine though. I just also need access
> to the types declared in the generated header.

Ok, so you have:

        lib parser : parser.g ;
        exe whatever : whatever.cpp parser ;

? In that case, you can either use the implicit-dependency feature,
as documented at:

or you actually need to make the generator add usage requirements, as I've described
in the previous post.

Personally, I always got away with <implicit-dependency>, whether you're willing to
use just that, or modify the generator, is up to you :-)

- Volodya

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at