Boost logo

Boost-Build :

Subject: Re: [Boost-build] how to use exe target from generator tool
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-02-28 16:25:48


AMDG

On 02/25/2012 07:42 PM, George Georgiev wrote:
> I am Boost.Build newbie. I have project that is generator itself. And
> I have second project that should use the just compiled generator tool
> to produce cpp and header files.
>

Look at the quickbook toolset. It has some
features that you don't need, but the important
part is to
a) define a feature to pass the tool executable
b) Create a custom generator class that adds
   a dependency on your tool.
c) use toolset.flags to convert the feature to
   a VARIABLE in the updating action.

> My generation jam code so far looks like:
>
> //////////////// jamcompil ////////////////
> rule generate ( target : source * : properties * )
> {
> echo $(target) $(source) ;
> }
>
> actions generate
> {
> generator $(<) $(>)
> }
>
> //////////////// jamfile ////////////////
> import type ;
> import scanner ;
> import generators ;
> import jamcompil ;
>
> type.register COMPIL : compil ;
>
> class compil-scanner : common-scanner
> {
> rule pattern ( )
> {
> return "[ \t]*import[ \t]*\"([^\"]*)\"[ \t]*;" ;
> }
> }
>
> scanner.register compil-scanner : include ;
>
> type.set-scanner COMPIL : compil-scanner ;
> generators.register-standard jamcompil.generate : COMPIL : CPP ;
>
>
> I cannot find how to specify the jamcompil generate actions to use the
> executable compiled from the other project. How it to take the
> executable from the exact location and how to make the target to
> depend on it - if it is updated this to cause the targets to be
> regenerated
>

In Christ,
Steven Watanabe


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