Boost logo

Boost-Build :

Subject: Re: [Boost-build] switching on toolset
From: Edward Diener (eldiener_at_[hidden])
Date: 2015-06-17 11:06:01


On 6/17/2015 12:01 AM, Gennadiy Rozental wrote:
> Edward Diener <eldiener <at> tropicsoft.com> writes:
>
>> Look at predef-check and predef-require in the Boost predef library. It
>> is still a bit buggy but it is what you want.
>
> I do not understand how to use these or what they are doing.
>
> For now , what I need is rather simple. If toolset is gcc with version less
> then equal to 4.6 add std=c++0x otherwise add std=c++11.
>
> How would I express this using the rules you've mentioned?

At the top of your jamfile add:

import your-path-to-predef/predef/check/predef : require check :
predef-require predef-check ;

In the requirements section of a rule invocation add:

[ predef-check "BOOST_COMP_GNUC > 0" "BOOST_COMP_GNUC <= 4.6" : :
<cxxflags>-std=c++0x : <cxxflags>-std=c++11 ]


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