Boost logo

Boost-Build :

Subject: Re: [Boost-build] [boost-build] how to link against library conditional on compiler version?
From: John Maddock (jz.maddock_at_[hidden])
Date: 2016-08-04 12:52:26


> Now, other components just need to add foo_api as a dependency, and
> they'll automatically get the correct version.
>
> I know how to create a similar library in boost.build
>
> lib foo_api : : <name>foo <file>foo.a ;
>
>
> I don't, however, know how to conditionally specify the <file>
> argument dependent on compiler version.
>
> How can I check the compiler version and select the correct library?

I don't know the exact invocation (hopefully Rene will chime in here),
but Boost.Predef, specifically [ predef-check ] in combination with
BOOST_COMP_GNUC should be able to do that, see
http://www.boost.org/doc/libs/1_60_0/libs/predef/doc/html/predef/check_utilities.html.

HTH, John.


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