Boost logo

Boost-Build :

Subject: Re: [Boost-build] [build] Compiler requirement for a header only library
From: Vladimir Prus (ghost_at_[hidden])
Date: 2011-04-26 08:03:05


On Tuesday, April 26, 2011 05:58:47 Dean Michael Berris wrote:
> On Tue, Apr 26, 2011 at 8:25 AM, Edward Diener <eldiener_at_[hidden]> wrote:
> > I have a header only library, which needs a particular compiler
> > requirement to be set when the library's header files are included. I do
> > not want to have to change the jam file for every library which uses my
> > library. Is there a way to do this with Boost Build so that any library
> > which includes one of my library's header files has the particular
> > option for the particular compiler set properly. I do know about
> > conditional requirements in Boost Build but I do not understand how a
> > particular jamfile in a header directory can enforce such an option for
> > other libraries.
>
> In your header-only lib you can check for the options used to compile
> it -- if it's not there, use #error or #warning to let the user know
> what's to be done.
>
> I'm not sure if there's a way to do this in Boost.Build itself,
> although it would be awesome if there was a way to do this.

While Boost.Build can technically do this, there are two problems:

- Each Boost library would have to explicitly list other Boost
header-only libraries that it uses
- Use code, which might not be using Boost.Build, won't take advantage
of this.

I don't know how to overcome those issues.

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build: http://boost.org/boost-build2

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