Boost logo

Boost-Build :

Subject: Re: [Boost-build] Specifying a somple C++ macro define in a jamfile
From: Jürgen Hunold (juergen.hunold_at_[hidden])
Date: 2011-03-27 11:54:52


Hi Erward,

On Sunday, 27. March 2011 17:39:38 Edward Diener wrote:
> How do I specify a simple macro definition, ie. #define SOMEMACRO, in a
> jamfile for the 'compile' rule ?

This should be documented at
http://www.boost.org/boost-
build2/doc/html/bbv2/overview/builtins/features.html

> I know how to add a cxxflag, but
> specifying a command-line #define is different fro different compilers.

This would be the "define" feature which seems to be missing on the page above.

The usage is simple:

<define>BOOST_SP_USE_QUICK_ALLOCATOR

at the same place(s) you'd put <cxxflags> et. al

> Do I have to know the compiler flag for each compiler to do this or is
> their some feature of Boost Build which does it for me ?

or use some toolset specific values:

<toolset>msvc:<define>_USE_MATH_DEFINES

Hope this helps,

yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold       ! Ingenieurgesellschaft für 
* voice: ++49 511 262926 57       ! Verkehrs- und Eisenbahnwesen mbH  
* fax  : ++49 511 262926 99       ! Lister Straße 15
* juergen.hunold_at_[hidden]        ! www.ivembh.de
* 
* Geschäftsführer:                ! Sitz des Unternehmens: Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover, HRB 56965
* PD Dr.-Ing. Alfons Radtke       !

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