Boost logo

Boost-Build :

Subject: Re: [Boost-build] Static library using shared one
From: Juraj Ivanèiæ (juraj.ivancic_at_[hidden])
Date: 2013-03-06 05:43:22


On 6.3.2013. 10:26, Paul Graphov wrote:

> I was unable to find an answer in the documentation so I decided to ask here.
> I'm working on a project that uses boost-build. Build process has two
> results: main binary file and regression test that is run
> automatically by boost-build. Both share a lot of common object files.
> To avoid copy-paste in Jamroot and complaints about targets with the
> same name I separated that common files into a static library (let it
> be my_lib). The problem is that some code in that library depends on
> boost.system which I want to be shared (unless I use link=static at
> command line). If I just mention my_lib and /boost//system in sources
> of both binaries they may be passed to the linker in wrong order. But
> if I also mention /boost//system in either sources or via <use> in
> requirements for my_lib, it seems to try compiling it both static and
> shared and fails with error:

The problem is that <link>static in in my_lib is propagated to the
/boost//system target.

Simplest fix is to force shared link on it - i.e.

<use>/boost//system/<link>shared


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