Boost logo

Boost-Build :

From: Christopher Currie (Christopher_at_[hidden])
Date: 2003-07-29 09:32:09


Vladimir Prus wrote:

> Hi Christopher,
>
>
>>My problem occurs when I try and put 'utils' in another
>>directory:
>>
>> # utils/Jamfile.v2
>> project utils : usage-requirements <include>. ;
>> lib utils : utils.cpp : : : <library>/boost/filesystem//fs ;
>>
>>
>> # app/Jamfile.v2
>> lib core : core.cpp : : : <library>/utils//utils ;
>> exe app : app.cpp core ;
>>
>> # ./Jamfile.v2
>> use-project /utils : utils ;
>>
>>Assume that 'core' needs to include some "utils.hpp" in order to build
>>properly. This code will only add the <include> usage requirement to the
>>exe, not to the lib.
>>
>>I could get around the problem by putting the <library> in the
>>requirements field instead of the usage requirements, but that results
>>in 'utils' being linked into 'core', which I imagine might result in
>>duplicate symbols if static libraries are built.
>
>
> That would really be funny with static linking, since you can't link once
> static library into another one. But I think your problem has an easy
> solution:
>
> lib core : core.cpp : <dependency>/utils//utils : : <library>/utils//utils
> ;
>
> The <dependency> feature cause usage-requirements to be propagated to from
> utils to "core", but nothing else (like attempt at linking) is done. Too bad
> the feature is not documented.

This helped a lot, thanks! However, looking at that line of code makes
it seem like I'm saying the same thing twice. Would it not make sense
for the <library> directive in usage-requirements to imply the
<dependency> directive? Or would this break some other scenario I'm
forgetting?

Thanks again,
Christopher

 


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