Boost logo

Boost-Build :

Subject: Re: [Boost-build] feature detection
From: Vladimir Prus (vladimir.prus_at_[hidden])
Date: 2016-10-25 04:56:26


Hi Alain,

On 25-Oct-16 11:19 AM, alainm wrote:
> Hi,
>
> Assuming I found the b2 documentation
> (http://www.boost.org/build/doc/html/) I did not find how to implement
> automatic feature detection.
> What I need is something like CMake's check_function_exists or
> try_compile and, based on the answer, be able to set a macro definition.
>
> Right now, it seems that stuff like BOOST_NO_CXX11_DELETED_FUNCTIONS is
> defined manually in MPI.config header files which is not really a real
> world option.

You're right that finding this in documentation is harder than it should
be. Before we get to redo docs, I've put together an example,
here:

     https://github.com/boostorg/build/tree/develop/example/try_compile

It sets a macro based on compilability of a C++ source file, which seems
like what you're after. Could you give it a try?

Thanks,

-- 
Vladimir Prus
https://vladimirprus.com

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