Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-08-24 03:26:59


Toon Knapen wrote:

> > project foobar
> >
> > : requirements <library>/foobar//a
> >
> > ;
> >
> > To make sure child can always access the library.
>
> And this works brilliantly, yippiee !!!! But I now stumble on another
> problem: the order of the libraries. I do
>
> project foobar
>
> : requirements
>
> <library>/foobar//a
> <library>/foobar//c
> <library>/foobar//b
> ;
>
> and they appear on the link-line in sorted order ;-( I tried to use the
> '&&' syntax (as discussed in another thread) but it does not work for
> <library>. So I went back to using <find-shared-library> where the '&&'
> syntax does work but apparenatly the search-path that was set on the
> library is not added to the link-line '-(

Yes. The <find-shared-library> is low-level instrument -- it merely adds the
specified library to the command line (with "-l", if compiler needs it). It
has no idea about targets you've declared, so does not add search path.

The simple but dirty solution is to use <library-path> feature -- another low
level one.

> BTW, when should <library> be used and when should <find-shared-library>
> be used ?

Generally, <library> should be preferred to <find-shared-library> in all
cases. The second one is too dumb and is mainly for internal purposed. But
that brings us back to the order question. I think you need specific order of
libraries because there are dependencies between them.

You can express that using the <use> property. Hmm... it seems I've started to
making that property work with searched libraries, but has not finished
yet... done now, you'd need to fetch revision 1.4 of tools/unix.jam

Now, if I have:

exe main : main.cpp b a ;
lib a ;
lib b ;

Then the command line contains: "-la -lb". If I have

exe main : main.cpp b a ;
lib a ;
lib b : : <use>a ;

then the command line contains "-lb -la", as it should if 'b' uses function
from 'a'.

So you can try this approach, too.

> (I hope that once this is solved my project will compile fine and stop
> annoying you with my waterfall of questions ;0)

Let's see ;-)

- Volodya

 


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