2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 00:52:16 +00:00

Fix handling of conditinal properties, broken a recent commit.

1. Don't break where there are several elements in condition.
2. Don't validate <toolset> feature in condition, since we might
   not have initialized all possible toolsets.


[SVN r22964]
This commit is contained in:
Vladimir Prus
2004-05-28 10:45:31 +00:00
parent 521b58e5e9
commit 1143b23a6c
2 changed files with 28 additions and 5 deletions

View File

@@ -297,6 +297,7 @@ local rule validate-feature ( feature )
local rule expand-subfeatures-aux (
feature ? # The name of the feature, or empty if value corresponds to an implicit property
: value # The value of the feature.
: dont-validate ? # If set, no validation of value string will be done
)
{
if $(feature)
@@ -312,8 +313,11 @@ local rule expand-subfeatures-aux (
{
validate-feature $(feature) ;
}
validate-value-string $(feature) $(value) ;
if ! $(dont-validate)
{
validate-value-string $(feature) $(value) ;
}
local components = [ regex.split $(value) "-" ] ;
# get the top-level feature's value
@@ -360,6 +364,7 @@ rule expand-subfeatures (
properties * # property set with elements of the form
# <feature>value-string or just value-string in the
# case of implicit features.
: dont-validate ?
)
{
local result ;
@@ -368,7 +373,7 @@ rule expand-subfeatures (
# Don't expand subfeatures in subfeatures
if ! [ MATCH "(:)" : $(p:G) ]
{
result += [ expand-subfeatures-aux $(p:G) : $(p:G=) ] ;
result += [ expand-subfeatures-aux $(p:G) : $(p:G=) : $(dont-validate) ] ;
}
else
{

View File

@@ -128,7 +128,7 @@ rule expand-subfeatures-in-conditions ( properties * )
local result ;
for local p in $(properties)
{
local s = [ MATCH ([^:]*):(<.*) : $(p) ] ;
local s = [ MATCH (.*):(<.*) : $(p) ] ;
if ! $(s)
{
result += $(p) ;
@@ -136,8 +136,26 @@ rule expand-subfeatures-in-conditions ( properties * )
else
{
local condition = $(s[1]) ;
# Condition might include several elements
condition = [ regex.split $(condition) "," ] ;
local value = $(s[2]) ;
local e = [ feature.expand-subfeatures $(condition) ] ;
local e ;
for local c in $(condition)
{
if [ MATCH "^(<toolset>|<toolset->)" : $(c:G) ]
{
# It common that condition includes a toolset which
# was never defined, or mentiones subfeatures which
# were never defined. In that case, validation will
# only produce an spirious error, so don't validate.
e += [ feature.expand-subfeatures $(c) : true ] ;
}
else
{
e += [ feature.expand-subfeatures $(c) ] ;
}
}
if $(e) = $(condition)
{
result += $(p) ;