Boost logo

Boost-Build :

From: Nicola Musatti (Nicola.Musatti_at_[hidden])
Date: 2006-11-22 10:29:32


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....

Thank you,
Nicola Musatti


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