Boost logo

Boost-Build :

Subject: Re: [Boost-build] feature, properties, variants, and all the rest
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2016-12-23 15:29:21


On 12/23/2016 09:05 AM, Stefan Seefeld wrote:
> Hello,
> I'm still working on my b2 Python prototype (haven't given up just yet !
> ;-) ). Instead of reinventing everything from scratch, I'm trying hard
> to reuse ideas from b2 wherever I can. However, that is quite hard,
> given the sparseness of its documentation...
> Right now I'm trying to understand properties and how they propagate
> from the command-line & jamfiles to targets and actions.
> So let me outline my understanding of these concepts, combined with a
> few basic questions I have:
> * Property sets are sets of properties (duh !). What does the
> 'PropertySet' class (in build/ add over a simple set()
> (or list()) of property instances ?

  It's more like a dict than a set. The main
benefit is that it mirrors Jam, which makes
porting jam modules much simpler. There are
also some functions specific to properties,
like target_path or base, free, propagated, etc.

> * A Property is a feature with an associated value. What is a LazyProperty ?

I have no idea, since there's no such thing in Jam.

> * A Feature is a type of a property: it defines certain property
> attributes, as well as ways to interpret it. Feature values are
> typically restricted to finite sets of values, unless they are 'free'.
> What attribute decides whether values are accumulative or exclusive ?
> (For example, the 'link' value is either 'static' or 'shared', but
> 'include' is an accumulative set of paths.) Further:

  Only free features can have multiple values. In
retrospect combining 'multiple values' with
'values not from a predefined list' was probably
a mistake. There are a number of cases where
the correct behavior is 'exactly one path',
for instance.

> - what is a 'sub-feature' ?

  It's a feature that is only present when another
property is present:
Ex: <toolset>msvc-14.0 is actually shorthand for
<toolset>msvc <toolset-msvc:version>14.0
where <toolset-msvc:version> is a subfeature.

> - what is a 'symmetric' feature ?

  You can mostly ignore this. It only
means that when building a target path,
the default value of the feature will
be included. The primary example of
this is <toolset>.

> - what is a 'composite' feature ?

A composite feature contains other properties:
Ex: <variant>release -> <optimization>on
    <debug-symbols>off <define>NDEBUG

> It would be great to see examples of the above. I promise to try to
> capture my understanding in a document, so this will at least result in
> improved documentation. Please help ! :-)

In Christ,
Steven Watanabe

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at