Boost logo

Boost :

Subject: Re: [boost] <link>header?
From: Peter Dimov (lists_at_[hidden])
Date: 2018-01-22 12:31:32

Steven Watanabe wrote:

> So the question is what should <link>header do for libraries that do not
> have a header-only mode?

Fall back to <link>static, I suppose.

> > Furthermore, after thinking about it a bit, I think that we might even
> > have room for a fourth link type, <link>source, in response to which the
> > library target would pass an appropriate <source> usage-requirement
> > upwards. (<source>error_code.cpp in Boost.System's case.)
> You don't need usage requirements for this, and it's not quite the right
> thing either, as it will continue to propagate up past any linking steps.

I think that it's exactly what I want (although I haven't yet tried it out.)
If we take the example at which you hint later:

exe x1 : x1.cpp boost_system : <cxxflags>-std=c++03 <define>FOO ;
exe x2 : x2.cpp boost_system : <cxxflags>-std=c++11 <define>BAR ;

a <source>error_code.cpp usage requirement will result in x1 and x2 getting
their own copy of error_code.cpp, each compiled with the respective cxxflags
and defines. Right?

Boost list run by bdawes at, gregod at, cpdaniel at, john at