Boost logo

Boost-Build :

Subject: Re: [Boost-build] Is it possible to set a features default value with an indirect conditional target ?
From: Aaron Boman (aaron_at_[hidden])
Date: 2016-06-18 10:39:29

> rule set_default_abi ( )

> {

> local abi =<conditional>@default_abi ;

> return $(abi) ;

> }

That's not how <conditional> properties work. You must specify the
property on a target. When the target is considered for building, then
the function
name as the value on the <conditional> will be called with the
properties to build
for that target. The callback function is then supposed to return any
properties to add to the property set.

You almost had default_abi set up correctly. The only thing you need to
is the return statement from `return $(tmp) ;` to `return <abi>$(tmp) ;`

Then, you must specify `<conditional>@default_abi` on a *target's*

exe kernel : kernel_main.c : <conditional>@default_abi ;

This won't actually set a default value for the <abi> feature, but it
should correctly set
the <abi> value for the target given.

So, to answer your original question, no, it is not possible to set the
default value
of a feature with an indirect conditional target as $(properties) is not
until the virtual target generation phase has begun.


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