diff --git a/new/feature.jam b/new/feature.jam index 77412892d..dd8d78c77 100644 --- a/new/feature.jam +++ b/new/feature.jam @@ -73,7 +73,9 @@ import utility ; # toolset, always generates a corresponding subvariant # directory. - free # as described in previous documentation + free + + incidental path # the (free) feature's value describes a path which # might be given relative to the directory of the @@ -318,8 +320,8 @@ local rule expand-subfeatures-aux ( # rule expand-subfeatures ( properties * # property set with elements of the form - # value-string or just value-string in the - # case of implicit features. + # value-string or just value-string in the + # case of implicit features. ) { local result ; diff --git a/new/make.jam b/new/make.jam index a49eac052..b41c32edb 100644 --- a/new/make.jam +++ b/new/make.jam @@ -21,7 +21,7 @@ rule make-target-class ( name : project : sources * : requirements * rule construct ( source-targets * : properties * ) { local t = [ new virtual-target $(self.name) - : $(self.project) : [ property.remove-free $(properties) ] ] ; + : $(self.project) : [ property.remove free incidental : $(properties) ] ] ; local a = [ new action $(t) : $(source-targets) : $(self.make-rule) : $(properties) ] ; $(t).action $(a) ; diff --git a/new/property.jam b/new/property.jam index 8fdabfab4..48877d04a 100644 --- a/new/property.jam +++ b/new/property.jam @@ -201,15 +201,15 @@ rule make ( specification * ) return $(result) ; } -# Returns a property sets which include all the elements in 'properties', -# except for free properties. -rule remove-free ( properties * : feature-space ? ) +# Returns a property sets which include all the elements in 'properties' that +# do not have attributes listed in 'attributes'. +rule remove ( attributes + : properties * : feature-space ? ) { feature-space ?= feature ; local result ; for local e in $(properties) { - if ! free in [ $(feature-space).attributes $(e:G) ] + if ! [ set.intersection $(attributes) : [ $(feature-space).attributes $(e:G) ] ] { result += $(e) ; } @@ -217,14 +217,15 @@ rule remove-free ( properties * : feature-space ? ) return $(result) ; } -# Returns a property set which include all free properties in 'properties'. -rule take-free ( properties * : feature-space ? ) +# Returns a property set which include all properties in 'properties' that have +# any of 'attributes'. +rule take ( attributes + : properties * : feature-space ? ) { feature-space ?= feature ; local result ; for local e in $(properties) { - if free in [ $(feature-space).attributes $(e:G) ] + if [ set.intersection $(attributes) : [ $(feature-space).attributes $(e:G) ] ] { result += $(e) ; } @@ -305,7 +306,7 @@ local rule __test__ ( ) catch "Invalid property 'value': 'value' is not a value of implicit feature." ; - assert.result gcc on - : remove-free gcc foo on : $(test-space) ; + assert.result on + : remove free implicit : gcc foo on : $(test-space) ; } diff --git a/new/targets.jam b/new/targets.jam index a0bf5d52c..f0cc12d62 100644 --- a/new/targets.jam +++ b/new/targets.jam @@ -174,7 +174,8 @@ rule main-target ( name : project ) } else { - # Find the alternative with the longest set of non-free requirements + # Find the alternative with the longest set of non-free and + # non-indicental requirements local r = [ $(alternatives).indices ] ; # First compute the length of requirements sets @@ -184,7 +185,7 @@ rule main-target ( name : project ) local target = [ $(alternatives).at $(p) : 1 ] ; assert.equal [ is-a $(target) : basic-target ] : true ; local props = [ $(target).requirements ] ; - req-length += [ sequence.length [ property.remove-free + req-length += [ sequence.length [ property.remove free : [ $(target).requirements ] ] ] ; } @@ -211,18 +212,19 @@ rule main-target ( name : project ) } } - # Add additional subvariant element for the targets which free properties - # are not equal to project's. + # Add additional subvariant element for the targets which free, + # non-incidental properties are not equal to project's. - local pr = [ property.take-free - [ project.attribute $(self.project) requirements ] ] ; + local pr = [ property.take free : [ property.remove incidental : + [ project.attribute $(self.project) requirements ] ] ] ; for local v in $(result) { local action = [ $(v).action ] ; if $(action) { - local properties = [ property.take-free [ $(action).properties ] ] ; + local properties = [ property.take free : [ property.remove incidental : + [ $(action).properties ] ] ] ; if $(properties) != $(pr) { diff --git a/v2/build/feature.jam b/v2/build/feature.jam index 77412892d..dd8d78c77 100644 --- a/v2/build/feature.jam +++ b/v2/build/feature.jam @@ -73,7 +73,9 @@ import utility ; # toolset, always generates a corresponding subvariant # directory. - free # as described in previous documentation + free + + incidental path # the (free) feature's value describes a path which # might be given relative to the directory of the @@ -318,8 +320,8 @@ local rule expand-subfeatures-aux ( # rule expand-subfeatures ( properties * # property set with elements of the form - # value-string or just value-string in the - # case of implicit features. + # value-string or just value-string in the + # case of implicit features. ) { local result ; diff --git a/v2/build/property.jam b/v2/build/property.jam index 8fdabfab4..48877d04a 100644 --- a/v2/build/property.jam +++ b/v2/build/property.jam @@ -201,15 +201,15 @@ rule make ( specification * ) return $(result) ; } -# Returns a property sets which include all the elements in 'properties', -# except for free properties. -rule remove-free ( properties * : feature-space ? ) +# Returns a property sets which include all the elements in 'properties' that +# do not have attributes listed in 'attributes'. +rule remove ( attributes + : properties * : feature-space ? ) { feature-space ?= feature ; local result ; for local e in $(properties) { - if ! free in [ $(feature-space).attributes $(e:G) ] + if ! [ set.intersection $(attributes) : [ $(feature-space).attributes $(e:G) ] ] { result += $(e) ; } @@ -217,14 +217,15 @@ rule remove-free ( properties * : feature-space ? ) return $(result) ; } -# Returns a property set which include all free properties in 'properties'. -rule take-free ( properties * : feature-space ? ) +# Returns a property set which include all properties in 'properties' that have +# any of 'attributes'. +rule take ( attributes + : properties * : feature-space ? ) { feature-space ?= feature ; local result ; for local e in $(properties) { - if free in [ $(feature-space).attributes $(e:G) ] + if [ set.intersection $(attributes) : [ $(feature-space).attributes $(e:G) ] ] { result += $(e) ; } @@ -305,7 +306,7 @@ local rule __test__ ( ) catch "Invalid property 'value': 'value' is not a value of implicit feature." ; - assert.result gcc on - : remove-free gcc foo on : $(test-space) ; + assert.result on + : remove free implicit : gcc foo on : $(test-space) ; } diff --git a/v2/build/targets.jam b/v2/build/targets.jam index a0bf5d52c..f0cc12d62 100644 --- a/v2/build/targets.jam +++ b/v2/build/targets.jam @@ -174,7 +174,8 @@ rule main-target ( name : project ) } else { - # Find the alternative with the longest set of non-free requirements + # Find the alternative with the longest set of non-free and + # non-indicental requirements local r = [ $(alternatives).indices ] ; # First compute the length of requirements sets @@ -184,7 +185,7 @@ rule main-target ( name : project ) local target = [ $(alternatives).at $(p) : 1 ] ; assert.equal [ is-a $(target) : basic-target ] : true ; local props = [ $(target).requirements ] ; - req-length += [ sequence.length [ property.remove-free + req-length += [ sequence.length [ property.remove free : [ $(target).requirements ] ] ] ; } @@ -211,18 +212,19 @@ rule main-target ( name : project ) } } - # Add additional subvariant element for the targets which free properties - # are not equal to project's. + # Add additional subvariant element for the targets which free, + # non-incidental properties are not equal to project's. - local pr = [ property.take-free - [ project.attribute $(self.project) requirements ] ] ; + local pr = [ property.take free : [ property.remove incidental : + [ project.attribute $(self.project) requirements ] ] ] ; for local v in $(result) { local action = [ $(v).action ] ; if $(action) { - local properties = [ property.take-free [ $(action).properties ] ] ; + local properties = [ property.take free : [ property.remove incidental : + [ $(action).properties ] ] ] ; if $(properties) != $(pr) { diff --git a/v2/tools/make.jam b/v2/tools/make.jam index a49eac052..b41c32edb 100644 --- a/v2/tools/make.jam +++ b/v2/tools/make.jam @@ -21,7 +21,7 @@ rule make-target-class ( name : project : sources * : requirements * rule construct ( source-targets * : properties * ) { local t = [ new virtual-target $(self.name) - : $(self.project) : [ property.remove-free $(properties) ] ] ; + : $(self.project) : [ property.remove free incidental : $(properties) ] ] ; local a = [ new action $(t) : $(source-targets) : $(self.make-rule) : $(properties) ] ; $(t).action $(a) ;