Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-11-22 11:22:56


On Wednesday 22 November 2006 18:29, Nicola Musatti wrote:
> Hallo,
> In order to build Boost.Serialization with some compilers the path to an
> external installation of Spirit must be specified on the command line
> before $(BOOST_ROOT). One way to achieve that is to ensure that
> <cxxflags>-I/path/to/spirit is defined.
>
> To ensure that Serialization builds with all the supported toolsets I'd
> like to define <cxxflags> as above only for the toolset that require it and
> only if $(SPIRIT_ROOT) is defined.
>
> I had thought of writing a rule that took the toolset as argument and
> checked whether <cxxflags> was needed, roughly as follows (pseudo bjam
> code):
>
> rule include-spirit ( toolset )
> {
> local SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ;
> if ( $(SPIRIT_ROOT) && $(toolset) in borland vc cw )
> {
> return <toolset>$(toolset):<cxxflags>-I$(SPIRIT_ROOT) ;
> }
> }
>
> To be used as (pseudo bjam code again):
>
> lib boost_serialization
>
> : $(SOURCES).cpp
> :
> : <link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
>
> include-spirit
>
> : <link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
>
> ;
>
> However I don't know the correct way to do it and I couldn't find an
> example to copy from....

The feature you're looking for is "indirect conditional requirement",
documented at:

http://boost.org/boost-build2/doc/html/bbv2/advanced/targets.html#bbv2.advanced.targets.requirements

HTH,
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