Boost logo

Boost-Build :

Subject: Re: [Boost-build] Question: windows static library that uses a dll.
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-09-11 17:51:04


AMDG

On 09/11/2012 01:48 PM, Juan Carlos Franzoy wrote:
> Hello. I'm trying to migrate some program from makepp(unix)
> VisualStudio(windows) to boost.build.
>
> I have spent all the day trying to build a trivial example without success.
> I hope somebody out there can help me.
>
>
> The scenario is the following:
>
> lib A, is build as a dll or static library.
> lib B is build only as a static library. B uses A.
> exe C uses B and A.
>
> In unix, i had no problems. But in windows ...
>
> In windows I have
> - two versions of A
> - A.dll (shared) A.lib(importlib)
> - AS.lib (static)
> - two versions of B, both static:
> - B.lib uses A.lib, and consecuently A.dll. B.lib referes A symbols
> with __declspec(dllimport)
> - BS.lib uses AS.lib. BS.lib doesn't use __declspec(dllimport)
> - two versions of C
> - C.exe uses B.lib and A.lib ( and A.dll )
> - CS.exe uses BS.lib and AS.lib
>
> How can I express this in Jamfiles?
>

You should be able to write this out basically
as is (warning untested):

lib A : $(A-sources) :
  <link>shared <define>A_DYN_LINK : : # requirements
  <define>A_DYN_LINK ; # usage requirements
lib AS : $(A-sources) : <link>static ;
lib B : $(B-sources) A : <link>static ;
lib BS : $(B-sources) AS : <link>static ;
exe C : A B ;
exe CS : AS BS ;

In Christ,
Steven Watanabe


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