List Info

Thread: Setting a feature for specific subsets based on an external condition




Setting a feature for specific subsets based on an external condition
user name
2006-11-22 15: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_LIN
K=1
	  include-spirit
	:
	:
<link>shared:<define>BOOST_SERIALIZATION_DYN_LIN
K=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


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Setting a feature for specific subsets based on an external condition
user name
2006-11-22 16: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_LIN
K=1
>
> 	  include-spirit
>
> 	:
<link>shared:<define>BOOST_SERIALIZATION_DYN_LIN
K=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.a
dvanced.targets.requirements

HTH,
Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )