Peter Dimov wrote:
Steven Watanabe wrote:
import feature ; feature.feature cxx11 : on : optional composite propagated ; feature.compose <cxx11>on : <toolset>gcc:<cxxflags>-std=c++11 ;
Thanks Steven. Putting this in my user-config.jam works in that it creates the feature and allows me to use it, but it doesn't actually seem to pass -std=c++11 to the compiler.
In this thread: http://boost.2283326.n4.nabble.com/Building-OpenMP-targets-td4650306.html it's claimed that feature.compose doesn't parse its second argument properly, which is why the above doesn't work, although it's supposed to. This, however, works: import feature ; import toolset ; using gcc ; feature.subfeature toolset gcc : std : cxx11 : optional composite propagated ; feature.compose toolset-gcc:stdcxx11 : <cxxflags>-std=c++11 ; and is actually better for my needs, because it supports building for both C++03 and C++11 at once: b2 toolset=gcc,gcc-cxx11