|
Boost : |
Subject: Re: [boost] setting <cxxflags> and <linkflags> in Jamfile?
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2013-02-14 14:37:58
> > if the define BOOST_USE_XYZ is given at b2/bjam command-line how can I
> set
> > special compiler- and linker-flags in the Jamfile?
> >
> > something like this:
> >
> > Jamfile.v2:
> >
> > *project boost/abc
> > : requirements
> > <toolset>gcc-4.7,<defined>BOOST_USE_XYZ:<cxxflags>-fxyz
> > <toolset>gcc-4.7,<defined>BOOST_USE_XYZ:<linkflags>"-static-libxyz"
> > <link>static
> > <threading>multi
> > : source-location ../src
> > : usage-requirements
> > <link>shared:<define>BOOST_ABC_DYN_LINK=1
> > ;
> > *
> > if the lib is build with b2 toolset=gcc cxxflags="-DBOOST_USE_XYZ" then
> > -fxyz static-libxyz is applied to the compiler otherwise not.
> > How can I achieve this behaviour?
> >
>
> You should use define=BOOST_USE_XYZ instead of cxxflags,
> and <define>BOOST_USE_XYZ in the Jamfile. However, it's
> probably to use
>
> feature xyz : on : optional propagated composite ;
> feature.compose <xyz>on : <define>BOOST_USE_XYZ ;
> <toolset>gcc-4.7,<xyz>on:<cxxflags>-fxyz
> ...
> bjam ... xyz=on
> ...
>
really nice - thank you!
Does an convention exist how such thing like BOOST_USE_XYZ should be named,
e.g.
BOOST_USE_XYZ should enable segmented stack for boost.coroutine.
Might bjam ... use_segmented_stacks=on be OK? (I didn't found a hint about
naming in the documentation).
best regards,
Oliver
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk