mirror of
https://github.com/boostorg/build.git
synced 2026-02-17 01:32:12 +00:00
Introduce 'incidental' features.
* new/feature.jam: The above change.
* new/property.jam
(remove): Renamed & generalized from 'remove-free'.
(take): Likewise.
[SVN r14752]
This commit is contained in:
@@ -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
|
||||
# <feature>value-string or just value-string in the
|
||||
# case of implicit features.
|
||||
# <feature>value-string or just value-string in the
|
||||
# case of implicit features.
|
||||
)
|
||||
{
|
||||
local result ;
|
||||
|
||||
@@ -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) ;
|
||||
|
||||
@@ -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 <toolset>gcc <rtti>on
|
||||
: remove-free <toolset>gcc <define>foo <rtti>on : $(test-space) ;
|
||||
assert.result <rtti>on
|
||||
: remove free implicit : <toolset>gcc <define>foo <rtti>on : $(test-space) ;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
# <feature>value-string or just value-string in the
|
||||
# case of implicit features.
|
||||
# <feature>value-string or just value-string in the
|
||||
# case of implicit features.
|
||||
)
|
||||
{
|
||||
local result ;
|
||||
|
||||
@@ -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 <toolset>gcc <rtti>on
|
||||
: remove-free <toolset>gcc <define>foo <rtti>on : $(test-space) ;
|
||||
assert.result <rtti>on
|
||||
: remove free implicit : <toolset>gcc <define>foo <rtti>on : $(test-space) ;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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) ;
|
||||
|
||||
Reference in New Issue
Block a user