Boost logo

Boost-Build :

From: William Marié (william.marie_at_[hidden])
Date: 2008-08-24 02:58:32


Hi Jurko,
Thanks for your quick answer, yes you're right for i'm using the use-
project rule in order to get access to the jamfile defining this
library target. And actually i lied a bit saying that it was in order
to build an exe because it would have been that i could have had
install the library in the exe jamfile. My problem is that it's not
an exe but a unit-test and so i the dll is not install just after
being compiled the unit-test is ran and can't load the dynamic
library. does it make sense for you ?

Le 23 août 08 à 23:17, Jurko Gospodnetić a écrit :

> Hi William.
>
>> I tried to create rule that build a dll and install it at the same
>> time but
>> it doesn't seem to work and i don't know why :
>> rule kdll ( name ) {
>> lib $(name) : [ glob *.cpp ] : <link>shared ;
>> install dist$(name) : $(name) : <location> c:/temp :
>> <install-type>SHARED_LIB ;
>> }
>> this works perfectly when i build the library, but if i try to
>> build an exe
>> that uses that library, it builds the library but doesn't install
>> it. Is it normal ?, if yes how can i do that ?
>
> My guess is that your exe target is defined in a separate Jamfile
> which then calls the use-project rule in order to get access to the
> Jamfile defining this library target.
>
> If that is so then everything 'seems to work' perfectly when you
> build your library project and only when you build that whole
> project. This is because both your $(name) & dist$(name) targets
> have been defined as 'implicit' targets and get built automatically
> when building their project.
>
> If you make your dist$(name) target explicit (by calling
> 'explicit dist$(name) ;' after defining it) then building the
> library project will no longer automatically install the library
> and you will need to list the dist$(name) target explicitly in
> order to build it.
>
>
> And now to get back to your original problem...
>
> I think the cleanest currently available way to solve your issue
> is to make your exe have a build and an install target and then
> have its install target list the library's install target as its
> source. You then build the install target in order to get a working
> executable ready for running.
>
> An alternative that would get you what you want right now, but
> which I believe might actually be due to a bug, is to list the the
> dist$(name) target as a source for your exe. The bug I refer to is
> that Boost Build seems to silently ignore any sources that it can
> not consume when running a composing generator and here is can not
> consume the folder created by install nor the installed dll but
> only the import library (assuming you're using a shared library).
>
>
> Perhaps someone will correct me, but I do not believe there is
> currently a clean way to say 'when target A gets built then
> automatically build target B as well' when target B depends on A,
> at least not without modifying Boost Build. There is the dependency
> feature that does this and more but only when B does not depend on
> A (otherwise it would construct a circular dependency).
>
>
> Hope this helps.
>
> Best regards,
> Jurko Gospodnetić
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/
> listinfo.cgi/boost-build


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