
Roland Schwarz wrote:
Nicola Musatti wrote:
I have a working implementation, I'll post it tonight (GMT+1) from home, as I cannot post attachments from Gmane's web interface. The gist of it is the following function:
<snipped>
Based on your posting I tried to port the serialization.jam to bbv2.
It is almost working, however I need help with site-config.jam:
Here is what I have:
1) libs/serialization/build/Jamfile.v2:
On the top: import serialization ;
project boost/serialization : source-location ../src : requirements <conditional>@serialization.require-boost-spirit-support ;
2) libs/serialization/build/serialization.jam:
rule require-boost-spirit-support ( properties * ) { local result ; local req-legacy = false ;
if <toolset-msvc:version>6.5 in $(properties) { req-legacy = true ; } if <toolset-borland:version>8.5.2 in $(properties) { req-legacy = true ; }
if $(req-legacy) = true { result += <use>/site-config//spirit-1.6 ; }
return $(result) ; }
3) In site-config.jam:
project site-config ; alias spirit-1.6 : : : : <cxxflags>-I"H:/Projects/boost/SPIRIT_RC_1_6_2" ;
This seems to work fine. The problem is, that when the alias entry is missing from site-config the build aborts with an error, instead of just skipping the build of this particular library.
A work around would be to define only the path to the spirit-1.6 in site-config.jam, and return <build>no from require-boost-spirit-support when not available.
I was not able to find out how to do this.
Put path-constant SPIRIT_1_6_whatever : some_value ; to user-config.jam or to site-config.jam. In your rule, use: if $(SPIRIT_1_6_whatever) { ... } This should work. - Volodya