Boost logo

Boost-Build :

Subject: Re: [Boost-build] Target alternatives - one more time
From: Matthew Chambers (matt.chambers42_at_[hidden])
Date: 2011-07-14 17:12:46


On 7/14/2011 3:34 PM, Edward Diener wrote:
> Given a particular source I want to test if it will compile with a particular option, can someone
> show me how to set up the jamfile so that I compile for two different toolsets but not for any other
> toolsets ?
>
> As an example suppose I want to compile some_source.cpp with the -std=c++0x for gcc-4.6.0 and
> gcc-4.5.2, and I also want to compile some_source.cpp with no particular option for all toolsets.
> How do I do this in a jamfile ?
>

obj some_source : some_source.cpp ;
obj some_source : some_source.cpp : <toolset>gcc-4.6.0 : <cxxflags>-std=c++0x ;
obj some_source : some_source.cpp : <toolset>gcc-4.5.2 : <cxxflags>-std=c++0x ;

You could also do it all in a rule like:

rule some_source_requirements ( properties * )
{
   if gcc-4.6.0 gcc-4.5.2 in $(properties:G=) { return <cxxflags>-std=c++0x ; }
}

obj some_source : some_source.cpp : <conditional>@some_source_requirements ;


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