2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 01:32:12 +00:00

Really allow to configure different versions of STLPort.

Thanks to Reece Dunn for the bug report.


[SVN r26389]
This commit is contained in:
Vladimir Prus
2004-12-01 09:42:06 +00:00
parent a4f3de44f3
commit 23bca90019

View File

@@ -38,6 +38,7 @@ import project ;
import "class" : new ;
import targets ;
import property-set ;
import common ;
# Make this module into a project.
project.initialize $(__name__) ;
@@ -55,8 +56,6 @@ project stlport ;
feature.extend stdlib : stlport ;
feature.compose <stdlib>stlport : <library>/stlport//stlport ;
subfeature stdlib stlport : version : : optional propagated ;
# STLport iostreams or native iostreams
subfeature stdlib stlport : iostream : hostios : optional propagated ;
@@ -81,13 +80,33 @@ class stlport-target-class : basic-target
import feature project type errors generators ;
import set : difference ;
rule __init__ ( project : headers ? : libraries ? : requirements * )
rule __init__ ( project : headers ? : libraries ? : version ? )
{
basic-target.__init__ stlport : $(project) : : $(requirements) ;
basic-target.__init__ stlport : $(project) ;
self.headers = $(headers) ;
self.libraries = $(libraries) ;
self.version = $(version) ;
}
rule match ( property-set )
{
# Override the rule which detects if this basic-target is
# suitable for the specified property set.
# Basically, just checks that requested version is equal to
# self.version. We could have added stlport-$(version) to
# requirements, but then stlport-$(version) would show in
# the common properties, causing recursive building of ourselfs.
if [ $(property-set).get <stdlib-stlport:version> ] = $(self.version)
{
return stlport-$(self.version) ;
}
else
{
return no-match ;
}
}
rule generate ( property-set )
{
# Since this target is built with <stdlib>stlport, it will also
@@ -164,25 +183,39 @@ class stlport-target-class : basic-target
}
}
rule stlport-target ( headers ? : libraries ? : requirements * )
rule stlport-target ( headers ? : libraries ? : version ? )
{
local project = [ project.current ] ;
targets.main-target-alternative
[ new stlport-target-class $(project) : $(headers) : $(libraries)
: [ targets.main-target-requirements $(requirements) : $(project) ]
: $(version)
] ;
}
local .version-subfeature-defined ;
# Initialize stlport support.
rule init ( version ? :
headers # Location of header files
libraries ? # Location of libraries
)
{
feature.extend-subfeature stdlib stlport : version : $(version) ;
# FIXME: need to use common.check-init-parameters here.
# At the moment, that rule always tries to define subfeature
# of the 'toolset' feature, while we need to define subfeature
# of <stdlib>stlport, so tweaks to check-init-parameters are needed.
if $(version)
{
if ! $(.version-subfeature-defined)
{
feature.subfeature stdlib stlport : version : : propagated ;
.version-subfeature-defined = true ;
}
feature.extend-subfeature stdlib stlport : version : $(version) ;
}
# Declare the main target for this STLPort version.
stlport-target $(headers) : $(libraries) : <stdlib>stlport-$(version) ;
stlport-target $(headers) : $(libraries) : $(version) ;
}