Boost logo

Boost-Build :

Subject: Re: [Boost-build] How to remove specific compiler/linker flags
From: Benjamin Prestele (benjamin.prestele_at_[hidden])
Date: 2010-05-07 01:46:45


Am 06.05.2010 um 19:53 schrieb Anthony Foglia:
> Boris Schaeling wrote:
>> On Thu, 06 May 2010 16:36:11 +0200, Anthony Foglia <AFoglia_at_[hidden]> wrote:
>>> Boris Schaeling wrote:
>>>> On Thu, 06 May 2010 08:28:57 +0200, Benjamin Prestele <benjamin.prestele_at_[hidden]> wrote:
>>>>
>>>>> [...]while the <optimization>off gets propagated down to all dependent targets, the <cxxflags> do not. So basically all dependent targets need to to be updated with the additional <cxxflags>.
>>>> If the dependent targets are all defined in Jamfiles I think you can use:
>>>> project : requirements <cxxflags>-O2 ;
>>>
>>> What if he made a new variant? Would that get propagated? Or would a feature? (What if the feature were link-incompatible?)
>> While you can create a new propagating feature (have a look at /tools/build/v2/tools/builtin.jam where features are defined) the feature would need to be used somewhere. But I'm out now as I never made myself familiar with the script language bjam is based on (I'm waiting for the Python port :).
>
> You can set the feature from the command-line. So if he did something like
>
> feature.feature optimize-no-dead-strip : on off : composite propagated ;
> feature.compose <optimize-no-dead-strip>
> : on
> : <cflags>-O2
> ;
> feature.compose <optimize-no-dead-strip>
> : off
> : # You might need something here, but I don't know what's appropriate
> ;
>
> Then set <optimize-no-dead-strip>on as a requirement of the the top-most project (or set it to , it will be propagated down to all dependent projects. Or you could set it from the command line with
> bjam optimize-no-dead-strip=on
>
> The other option is to define a optimize-darwin variant and use that.

I've never defined a custom feature, but this really sounds like the cleanest way.
Thanks for your help!

Benjamin


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