Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-03-11 11:32:34


Consider the following simple Jamfile:

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

and the folloing invocation:

bjam define=FOO

The question is: should "b.cpp" be compiled with -DFOO? In this case, the
answer is clear: yes. Another example:

exe a : a.cpp b/<variant>release ;
lib b : b.cpp ;

What's now? I think that two rules are possible.

Rule 1.
If we try to build the same main target twice, and non-free properties are the
same in both requests, but one of the requests is direct, we use the
properties from direct request.

In first case, "b" is directly requested with "<variant>debug ....
<define>FOO"
and indirectly (by a) with "<variant>debug". So, we build with firsth property
set. In the second case, we build release version of "b" without <define>FOO.

Rule 2.
Directly requested free properties apply to all variants. This means that
<define>FOO will always be used when compiling "b.cpp", either with
<variant>debug, <variant>release, or any other combination of properties.

I just don't know which rule is best. Can anybody offer more reasonable
comment?

- 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