Boost logo

Boost-Build :

From: Joshua Napoli (jnapoli_at_[hidden])
Date: 2008-03-16 19:30:31


You can use "bjam debug release" to kick off the build of both variants with
one command. Normally, all four of your libraries would have the same target
name "libnatlib". You'll want one name for your library when you get around
to writing a test or exe that depends on it. Add "<target-os>windows" to the
"requirements" section (which follows the second ':') for the windows
builds, so that bjam can figure out which alternative fits which OS.

Josh

On Thu, Mar 13, 2008 at 5:35 AM, Rene Perlberg <Perle5000_at_[hidden]> 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
> ;
>
> So far I managed to compile the software either in debug or in release
> mode using the following command line (for release mode under windows):
> bjam libnatlib.windowsrelease
>
> That creates the release version of the library as expected in the root
> directory of the project in lib/ .
>
> My question now is, if there is a way to compile debug and release version
> together, either in windows or in linux, using just one command line. When
> writing the Jamfile just for one OS, i.E. linux both versions were
> compiled using just the command line "bjam" .
>
> Thanks in advance.
>
> René.
> --
> Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games!
> http://games.entertainment.gmx.net/de/entertainment/games/free
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build
>



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