diff --git a/src/build/feature.jam b/src/build/feature.jam index c656d8196..c4688e9c3 100644 --- a/src/build/feature.jam +++ b/src/build/feature.jam @@ -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 # 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 { diff --git a/src/build/property.jam b/src/build/property.jam index 0c7ff90be..72582a0d4 100644 --- a/src/build/property.jam +++ b/src/build/property.jam @@ -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 "^(|)" : $(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) ;