From: David Abrahams (dave_at_[hidden])
Date: 2002-12-05 11:04:43
Vladimir Prus <ghost_at_[hidden]> writes:
> David Abrahams wrote:
>> I'm afraid I don't understand what you're saying.
>> I'm saying this: in v1, people would often do:
>> lib foo : foo.cpp : <runtime-link>shared ;
>> Expecting it to build a shared library. I think you are now saying
>> that in v2:
>> lib foo : foo.cpp : <link>shared ;
>> Does in fact build a shared library.
> Yes, only <shared>true is used for now.
>> If that's the case, should we not
>> have a separate feature for specifying how a target should link to
>> its dependencies?
> I don't think so. If dependency is built with <shared>true, you link to
> it dynamically. In general, you cannot change your mind after dll is created,
> and link it statically.
I don't think we're saying the same thing.
It is possible to build a shared library which links statically to its
dependencies, is it not? This is an important usage model, at least on
Windows, where shared library vendors want to reduce the chance that
the installation of some newer (or older) shared "system" library
version will break their product in the field.
> I view the current "shared" as saying: "use shared linking whenever possible".
> Of course, if you want to use shared linking for exe, you'd have to use
> shared linking for dependencies that are libraries.
What about dependencies of those libraries?
> So, <shared> is propagated. If you introduce another feature, then I
> cannot say <shared>true on a single exe and have all dependency libs
> built as shared too.
I think it's important to be able to specify shared linking with one
broad stroke, but I'm not sure it should be propagated more than one
level through the (abstract) dependency graph.
-- David Abrahams dave_at_[hidden] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution
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