Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-10-20 06:59:34


On Wednesday 20 October 2004 15:29, Toon Knapen wrote:
> When looking at the explanation of the different types of features
> (incidental, propagated, ...) I was wondering what terminology you use
> to distinguish a feature that is translated into a flag for a certain
> compiler (such as <optimization>) and a feature that is directly passed
> on to the compiler (such as <cxxflags>).

There's no difference, in fact. At least in feature declaration. The
toolset.flags rule has all the magic:

flags gcc.compile.c++ OPTIONS <optimization>speed : -O3 ;
flags gcc.compile.c++ OPTIONS <cxxflags> ;

The first says to add -O3 when <optimization> is "speed" and the latter says
to add the value of <cxxflags>. I've just comitted some modifications to
toolset.flags (needed by Andre), so I'll describe this new interface:

rule flags ( ..........

variable-name # Variable that should be set on target
condition * : # A condition when this flag should be applied.
# Should be set of property sets. If one of
# those property sets is contained in build
# properties, the flag will be used.
# Implied values are not allowed:
# "<toolset>gcc" should be used, not just
# "gcc". Subfeatures, like in "<toolset>gcc-3.2"
# are allowed. If left empty, the flag will
# always used.

values * : # The value to add to variable. If <feature>
# is specified, then the value of 'feature'
# will be added.

In other words, when I commit the change the logic will be:

- The 'condition' specifies when the 'flag' will be applied:

flags ...... OPTIONS <optimization>speed : .......
flags ...... OPTIONS : .......

In the first case when <optimization>speed, in the second case -- always.

- The 'value' specifies that should be added to option -- either literal value
of a value of some feature:

flags ................. : -O3 ;
flags .................. : <cxxflags> ;

Hope this makes sense.

- 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