Boost logo

Boost-Build :

From: Phillip Seaver (phil_at_[hidden])
Date: 2005-06-02 10:25:09


Vladimir Prus wrote:

> This commit has one user-visible change. The code:
>
> exe a : a.cpp b ;
> obj b : b.cpp helper;
> lib helper ;
>
> No longer works -- the 'a' target won't link to 'helper'. However, this is
> pretty stange code and worked before almost by accident.

I'm using m10, and I've got something similar. Mine is more like this,
though:

lib helper ;
obj b : b.cpp <use>helper ;
lib a : a.cpp b ;

Will that work? Or should I put the <use> in the lib definition? One
nice thing about the way I have it now is that the usage requirements
(defines and includes, in particular) for 'helper' only apply to 'b',
which is fine, because the user of 'a' doesn't care about 'helper'.
Obviously, this isn't a requirement, but it's a nice feature for my
setup. It shrinks the command-line and reduces compile time (I suspect
-- I haven't tested).

On a side note, I've got a prebuilt library that requires a library that
I build, so I do something like this:

lib prebuilt : : <file>prebuilt_d.a <variant>debug <threading>single
<use>a ;
lib a : a.cpp ;
exe b : b.cpp prebuilt ;

IIRC, it builds 'a' when necessary. The problem is that it doesn't put
'a' after 'prebuilt' on the link line, so I get link errors (on Unix).
I worked around it by adding "<library-file>a" to the exe definition.

Thanks,

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