Boost C++ Libraries: Ticket #11408: Need C++ standard option for ./b2 and Jamfile https://svn.boost.org/trac10/ticket/11408 <p> A problem shortly forthcoming will be Boost libraries that can only build on some revisions of the C++ standard, but not others. In such a situation, let us imagine that a Boost.Hana which can only compile currently on some versions of clang ought not to be attempted on C++ 98 compilers as it makes no sense to do so. </p> <p> I would suggest a two part solution. </p> <p> The first is that ./b2 gets a std=98|03|11|14|1z parameter which adds -std=c++&lt;val&gt; on gcc and clang, and second that Jamfile gains an extra requirements option e.g. </p> <pre class="wiki">project boost/afio : requirements &lt;threading&gt;multi &lt;toolset&gt;&lt;check-macro&gt;__cplusplus &gt; 201103L # &lt;-- This is new &lt;link&gt;shared:&lt;define&gt;BOOST_AFIO_DYN_LINK=1 &lt;link&gt;shared:&lt;define&gt;BOOST_AFIO_SOURCE=1 &lt;link&gt;static:&lt;define&gt;BOOST_AFIO_SOURCE=1 &lt;include&gt;../../../boost/afio &lt;toolset&gt;gcc:&lt;cxxflags&gt;"-fvisibility-inlines-hidden -fstrict-aliasing -Wstrict-aliasing -Wno-unused -fargument-noalias -fvisibility=hidden -fasynchronous-unwind-tables" ... </pre><p> If a &lt;toolset&gt;&lt;check-macro&gt; appears, the compiler is executed with the code </p> <pre class="wiki">#include "boost/config.hpp" #if &lt;insert check-macro&gt; #else #error Not supported #endif </pre><p> And if the compiler compiles that without error, the library is enabled for this build. One can also, of course, check Boost.Config macros for compiler features. </p> <p> For even more flexible build enable detection, I'd also have a: </p> <pre class="wiki"> &lt;toolset&gt;&lt;check-header&gt;custom_header.hpp </pre><p> This tries to compile custom_header.hpp, and if that succeeds the build is enabled. </p> <p> Niall </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11408 Trac 1.4.3 Niall Douglas Sun, 21 Jun 2015 23:49:39 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11408#comment:1 https://svn.boost.org/trac10/ticket/11408#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">obsolete</span> </li> </ul> <p> Just learned off this list this is already implemented. Didn't know that before. Closing. </p> Ticket