Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2008-03-17 01:55:14


Rene Perlberg wrote:

> Hello to everyone,
>
> I'm new to Boost.Build and experiencing with an existing c++-project I designed myself.
>
> The software is designed for Linux and Windows, using #defines inside the code.
> #ifdef WIN32
> // use this part of the code
> #else
> // Probably linux, so use this part of the code
> #endif
>
> My Jamroot file contains:
> project : requirements <include>include ;
>
> My Jamfile is located under src/ and contains:
> project
> : usage-requirements <include>../include
> : build-dir ../lib
> ;
>
> ## Create release version
> # on linux
> lib libnatlib.linuxrelease
> : [ glob *.cpp ]
> : <variant>release
> ;
>
> # on windows
> lib libnatlib.windowsrelease
> : [ glob *.cpp ]
> : <find-shared-library>wsock32
> : <variant>release
> : <define>_WIN32
> ;
>
> ## Create debug version with #define NAT_DEBUG
> # on linux
> lib libnatlib.linuxdebug
> : [ glob *.cpp ]
> : <variant>debug
> ;
>
> # on windows
> lib libnatlib.windowsdebug
> : [ glob *.cpp ]
> : <find-shared-library>wsock32
> : <variant>debug
> : <define>NAT_DEBUG <define>_WIN32
> ;

Why are you defining 4 different variants? I think that _WIN32
is defined by windos compilers automatically. As for conditional
setting of NAT_DEBUG, the following should work:

        <target-os>NT:<define>NAT_DEBUG

Let me know if that works for you.

- 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