Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2007-08-05 14:23:30


We have a bug against C++ Boost where adding

        define=whatever

or

        cxxflags=whatever

on bjam command line has no effect. This is not specific
to C++ Boost. Given this Jamroot:

        exe a : a.cpp b ;
        lib b : b.cpp ;

and this command line:

        bjam -n define=FOO a

the 'a' target will be built with -DFOO and b will be built without.

When I implemented that behaviour, I though it to be very smart,
but now it seems confusing. Clearly users are accustomed to
define/cflags specification on the command line to apply "globally".

I see two solutions:

        1. Make 'free' features like 'define' and 'cflags' propagated. This
        will have undesirable effect that <define> set on some target
        will propagate to all dependencies.
        2. Make free features specified on the command like apply to
        all targets in the project located in ".", and any child project.
        The only concern I have about this approach is that it will
        still be impossible to specify define that will apply to all
        compilations. That is, if I have two projects A and B,
        in different directories with separate Jamroots, where A uses
        libraries from B, then:

                bjam define=FOO

        in A won't affect B.

Anybody can comment on those alternative or propose better ones?

- 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