Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-01-12 02:34:03


Hi Zbynek,
> Hello. I was trying to add <define>_DEBUG for <variant>debug and
> <define>NDEBUG for <variant>release. The way I did it was to add to the
> root Jamfile the following:
>
> project
>
> : requirements
>
> <variant>debug:<define>_DEBUG
> <variant>release:<define>NDEBUG
> ;
>
> Is this the proper way to do this? I just wanted the respected builds to
> be build with the defines. However I've found out that sometimes both
> symbols are defined - i.e. when I request debug variant with
> optimization (example attached). Is this the expected behavior or a bug?

This is expected behaviour, because builtin.jam contains the following code:

rule handle-ndebug ( property : properties * )
{
return <define>NDEBUG ;
}

feature.action <optimization>speed : handle-ndebug ;

If you ignore the 'feature.action' stuff, all it does is adding <define>NDEBUG
is <optimization> is set to "speed". The motivation is that I found it rather
strange when I found that NDEBUG is not set. And <optimization>speed seems
like a good way to turn on NDEBUG.

What do you think?

- 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