Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-11-19 03:46:48


Hi Leaf

Leaf, Garland wrote:

> I'm evaluating Boost.Build V2 and I have a hopefully quick question about
> linking to libraries. Apologies if it is something simple that I have
> missed.

[...]

> lib a : : <name>a ;
> lib b : : <name>b ;
>
> exe main :
> main.cpp
> a
> b
> ;
>
> It seems a little long winded to have to declare every library I want to
> link to in this way. I can certainly see the use of it if I want to link to
> different libraries for debug or release builds but quite often I don't
> need that functionality. Is it possible to do something like this?

[...]

> exe main :
> main.cpp
>
> <lib>a
> <lib>b
> ;
>
> I'm not actually asking for this feature (I can live without it), I just
> wanted to
> check if there was a way of doing it that I had missed.

The best approximation you can have now is

exe main : main.cpp [ lib zlib : : <name>zlib ] ;

I.e. you can declare target "inline". I think the decision to use separate
declaration for prebuilt libraries was made to make everything more regular.
In V1 there was <find-library> feature, and <library-file> feature, which had
to be specified by the target which uses searched or prebuilt library,
respectively. I was not happy with two different features for the
conceptually same thing, not to mention that the syntax for using built
library is different too.

- 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