Boost logo

Boost Testing :

Subject: Re: [Boost-testing] BJam and options for compiler versions >= x
From: John Maddock (jz.maddock_at_[hidden])
Date: 2015-03-25 12:38:00


On 25/03/2015 14:58, Raffi Enficiaud wrote:
> Hi,
>
> I have a test that should compile the code with C++11 options. For eg.
> GCC, I have a rule like this, which I do not like
>
> <toolset>gcc-4.4:<cxxflags>-std=c++0x
> <toolset>gcc-4.5:<cxxflags>-std=c++0x
> <toolset>gcc-4.6:<cxxflags>-std=c++0x
> <toolset>gcc-4.7:<cxxflags>-std=c++11
>
> I would like to know:
> - if there is a better way to do this
> - if it is possible to set the option "-std=c++11" for compilers with
> versions >= 4.7
>
I don't think we have a toolset option for that - though it sure would
be useful!

The way I do it, is not to second guess / change what options the test
runner is using, but either:

* Make the test a no-op if the C++11 features used aren't present, or:
* Use the Boost.Config build checks to disable the test altogether if
the features you require aren't available
(http://www.boost.org/doc/libs/1_57_0/libs/config/doc/html/boost_config/build_config.html).

The point of doing things this way, is it "works" for compilers other
than GCC, including those that don't have switches to select the
language dialect (ie the features either work or they don't).

Not quite what you were asking for yours, John.


Boost-testing list run by mbergal at meta-comm.com