Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2007-03-10 03:59:23


On Saturday 10 March 2007 09:10, David Abrahams wrote:
>
> # Returns usage requirements + list of created targets
> local rule try-one-generator-really ( project name ? : generator :
> target-type : property-set : sources * )
> {
> local targets =
> [ $(generator).run $(project) $(name)
> : $(property-set)
> : $(sources)
> ] ;
>
> local usage-requirements ;
> local success ;
>
> generators.dout [ indent ] returned $(targets) ;
>
> if $(targets)
> {
> success = true ;
>
> if [ class.is-a $(targets[1]) : property-set ]
> {
> usage-requirements = $(targets[1]) ;
> targets = $(targets[2-]) ;
> }
> else
> {
> usage-requirements = [ property-set.empty ] ;
> }
> }
>
> Apparently this means it's optional for the first element returned
> from running a generator property-set of usage requirements. Why is
> that a good idea? Wouldn't it be better to use a single protocol (all
> generators return either nothing, or a sequence starting with a
> property-set of usage requirements and followed by generated targets)?

It would be better if the need for this property-set return was known from
the very start. As it is, it was introduced relatively later, so auditing all
generators did not seem like a good idea, and user-written generators
are outside our control.

> Now as I modify gcc-linking-generator, I have to worry that
> unix-linking-generator might not give me a property set of usage
> requirements.

Practically, you can just check unix-linking-generator.

- 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