Boost logo

Boost-Build :

From: Pedro Ferreira (pedro.ferreira_at_[hidden])
Date: 2003-09-19 04:08:14


Hi all,

I have been considering how to solve the problem below for a while and would appreciate any suggestions.

The target system is Windows. For Linux things would be slightly different.

Suppose:

- I want to build library A that depends on library B;
- If A is to be linked as a dll, I want to link with library B, so I use <library>B;
- If A is to be linked statically, I just want to inherit B's usage requirements.

What's the best way to achieve this? What I've been doing is putting on A'sJamfile something like:

path-to-b = ...
...
<link>shared:<library>B
<link>static:<include>path-to-b

Works but is not very convenient because, if B happens to have usage requirements other that just the include path, things get really messy.

A post dated 16 August from Volodya to Peter Schoen proposes adapting $boost_root/test/unused/project-root.jam in order to generate a 'header-only-library'. I could do this for library B if A is to be linked statically. Could this be a starting point?

Any ideas?

Thanks in advance,

Pedro
 ------=_NextPart_000_00AA_01C37E95.F04BC430 Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2730.1700" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV>Hi all,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have been considering how to solve the problem below for a while and
would appreciate any suggestions.</DIV>
<DIV>&nbsp;</DIV>
<DIV>The target system is Windows. For Linux things would be slightly
different.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Suppose:</DIV>
<DIV>&nbsp;</DIV>
<DIV>- I want to build library A that&nbsp;depends on library B;</DIV>
<DIV>- If A is to be linked as a dll, I want to&nbsp;link with&nbsp;libraryB,
so I use &lt;library&gt;B;</DIV>
<DIV>- If A is to be linked statically, I just want to inherit&nbsp;B's usage
requirements.</DIV>
<DIV>&nbsp;</DIV>
<DIV>What's the best way to achieve this? What I've been doing is putting on A's
Jamfile something like:</DIV>
<DIV>&nbsp;</DIV>
<DIV>path-to-b = ...</DIV>
<DIV>...</DIV>
<DIV>&lt;link&gt;shared:&lt;library&gt;B</DIV>
<DIV>&lt;link&gt;static:&lt;include&gt;path-to-b</DIV>
<DIV>&nbsp;</DIV>
<DIV>Works but is not very convenient because, if B happens to have usage
requirements other that just the include path, things get really messy.</DIV>
<DIV>&nbsp;</DIV>
<DIV>A post dated 16 August&nbsp; from Volodya to Peter Schoen proposes adapting
$boost_root/test/unused/project-root.jam in order to generate a
'header-only-library'. I could do this for library B if A is to be linked
statically. Could this be a starting point?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any ideas?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks in advance,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Pedro</DIV></FONT></DIV></BODY></HTML>
 ------=_NextPart_000_00AA_01C37E95.F04BC430--


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