Boost logo

Boost-Build :

From: Phillip Seaver (phil_at_[hidden])
Date: 2005-07-05 11:33:57


learningnlp wrote:

> Couple questions; first:
>
> In my top level jamfile, I have:
>
> project jamroot : requirements <toolset>gcc:<cxxflags>"-pedantic" ;
>
> How can I do a double-condition:
>
> project jamroot : requirements <os>NT:<toolset>gcc
> :<cxxflags>"-pedantic" ;
>
> or should I be doing this using if/else statements? Specifically, I'm
> trying to differentiate between MinGW and gcc-linux.

project jamroot : requirements <os>NT,<toolset>gcc:<cxxflags>"-pedantic" ;

>
> Next question:
>
> If I have the following hierarchy:
>
> src/
> src/math
> src/math/vector
> src/math/matrix
> src/demo
>
> How can I get the src/math/jamfile to include both subprojects and
> unify them into one library without adding the sources of vector and
> matrix specifically? That is, if vector and matrix along the lines
> of:
>
> lib vectorlib : vector.cpp : <link>static ;
> lib matrixlib : matrix.cpp : <link>static ;
>
> I'd like to have src/math/jamfile as:
>
> lib math : vectorlib matrixlib : <link>static ;
>
> When I try this, I'm getting undefined references; that is, I have
> something like:
>
> exe demo : demo.cpp ../math//math ;
>
> and vector.cpp, matrix.cpp aren't being compiled (thus trying to use
> them is undefined reference).

You may need to use "use-project" -- something like:

# this gives the label "/vectorlib" to the project in the "vector"
sub-directory
use-project /vectorlib : vector ;
use-project /matrixlib : matrix ;

lib math : /vectorlib /matrixlib : <link>static ; # note the '/' on the
lib project names

You'll also need to add "project vectorlib ;" to the vector/Jamfile and
the equivalent to matrix/Jamfile. However, when I tested this here
(with milestone 10), it didn't link math in until I added a .cpp file to
the "lib math" line.

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