Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-04-13 09:57:56


Hi Max,
> >> The last code examples override the 'run' rule of a generator. You
> >> can use it to select all .a targets and then
> >> - construct XXX from all sources
> >> - construct YYY from XXX and all .a files
> >> - construct ZZZ
> >> When construction can be done by recursive call to
> >> generators.construct.
>
> As a result I use the followed code:
>
> type.register XXX : xxx ;
> generators.register-composing egcc.xxx-link : OBJ LIB : XXX ;
>
> type.register YYY : yyy ;
> generators.register-composing egcc.yyy-link : XXX LIB : YYY ;
>
> class egcc-linking-generator : linking-generator
> {
> rule run ( project name ? : property-set : sources * : multiple ? )
> {
> local libs ;
> for local s in $(sources)
> {
> if [ type.is-derived [ $(s).type ] LIB ]

Don't you want STATIC_LIB instead of LIB here?

> {
> libs += $(s) ;
> }
> }
>
> local xxx-result = [ generators.construct $(project) $(name) : XXX :
> $(property-set)
>
> : $(sources) ] ;
>
> local yyy-result = [ generators.construct $(project) $(name) : YYY :
> $(property-set)
>
> : $(xxx-result) $(libs) ] ;
>
> return [ construct-result $(yyy-result) : $(project) $(name) :
> $(property-set) ] ;
> }
> }
>
> generators.register [ new egcc-linking-generator egcc.link : LIB OBJ : EXE
>
> : <toolset>egcc ] ;
>
> actions xxx-link bind LIBRARIES
> {
> # construct XXX from all sources
> }
>
> actions cof-link bind LIBRARIES

I don't recall any generator called egcc.cof-link, there were egcc.yyy-link

> Is everything correct?

Looks right. But only trying on your project can tell for sure ;-)

- Volodya

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2
 

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