|
Boost-Build : |
From: Phillip Seaver (phil_at_[hidden])
Date: 2006-09-16 15:33:47
Phillip Seaver wrote:
> Kevin Wheatley wrote, on 9/6/2006 5:04 AM:
>
>> Phillip Seaver wrote:
>>
>>
>>> Any thoughts on this? One of my co-workers worked around the problem by
>>> doing a modules.poke of the requirements in the DLL build.jam and a
>>> modules.peek in the exe build.jam, so they're still only defined in one
>>> place, but I'd really like for this to work correctly.
>>>
>>>
>> you could create a requirements project, with a set of requirements
>> specified, then use an alias in that project as a fake target, you
>> would then referencwe that in the appropriate places...
>>
>> project c-dll
>> : requirements
>> <link>shared
>> : usage-requirements
>> <include>c
>> ;
>>
>> lib c : c/c.cpp b : : : <include>c ;
>>
>> # This allows us to pull a fake target to pick up the includes etc.
>> for this project
>> alias usage-requirements ;
>>
>> Then something like this...
>>
>> lib a : a/a.cpp : <link>static : : <include>a ;
>> lib b : b/b.cpp a : <link>static : : <include>b ;
>> use-project /c-dll : c-dll ;
>> build-project c-dll ;
>> exe d : d.cpp : <library>/c-dll//usage-requirements <link>static ;
>>
>> Kevin
>>
>
> That's a nicer work-around than the one we have now, but I think what I
> was trying to do should work. d has <use>c, which (correctly) does not
> make d link against c or b, but for some reason, it links against a.
>
> Phillip
I've changed my build.jam files to use the work-around suggested by
Kevin, and it's much cleaner than the modules.poke/peek solution that we
were using, but I think the original problem is a bug. d <use>'s c to
get the include paths from c, c has a and b statically linked into it,
but for some reason, a gets linked into d while b and c are not linked
into d.
Here's what my test case looked like:
lib a : a/a.cpp : <link>static : : <include>a ;
lib b : b/b.cpp a : <link>static : : <include>b ;
lib c : c/c.cpp b : <link>shared : : <include>c ;
exe d : d.cpp : <use>c <link>static ;
Phillip
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