2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-14 12:42:11 +00:00

Don't bark on conditionals in usage requirements.

[SVN r64496]
This commit is contained in:
Vladimir Prus
2010-07-31 11:40:34 +00:00
parent 8afdfd635c
commit 759f448b06
4 changed files with 14 additions and 23 deletions

View File

@@ -758,15 +758,16 @@ class ProjectAttributes:
non_free = property.remove("free", unconditional)
if non_free:
pass
# FIXME:
#errors.error "usage-requirements" $(specification) "have non-free properties" $(non-free) ;
get_manager().errors()("usage-requirements %s have non-free properties %s" \
% (specification, non_free))
t = property.translate_paths(property.create_from_strings(specification), self.location)
t = property.translate_paths(
property.create_from_strings(specification, allow_condition=True),
self.location)
existing = self.__dict__.get("usage-requirements")
if existing:
new = property_set.create(existing.raw() + t)
new = property_set.create(existing.all() + t)
else:
new = property_set.create(t)
self.__dict__["usage-requirements"] = new

View File

@@ -60,7 +60,7 @@ class Property(object):
(other._feature, other._value, other._condition))
def create_from_string(s, allow_condition = False):
def create_from_string(s, allow_condition=False):
condition = []
import types
@@ -98,9 +98,9 @@ def create_from_string(s, allow_condition = False):
return Property(f, value, condition)
def create_from_strings(string_list, validate=False):
def create_from_strings(string_list, allow_condition=False):
return [create_from_string(s, validate) for s in string_list]
return [create_from_string(s, allow_condition) for s in string_list]
def reset ():
""" Clear the module state. This is mainly for testing purposes.

View File

@@ -154,7 +154,6 @@ class PropertySet:
self.incidental_ = []
self.free_ = []
self.base_ = []
self.base_raw_ = []
self.dependency_ = []
self.non_dependency_ = []
self.conditional_ = []
@@ -199,18 +198,7 @@ class PropertySet:
raise BaseException ("Invalid property: '%s'" % p)
att = feature.attributes (get_grist (p))
# A feature can be both incidental and free,
# in which case we add it to incidental.
if 'incidental' in att:
pass
# self.incidental_.append (p)
elif 'free' in att:
# self.free_.append (p)
pass
else:
self.base_raw_.append (p)
if 'propagated' in att:
self.propagated_.append (p)
@@ -219,6 +207,8 @@ class PropertySet:
for p in properties:
# A feature can be both incidental and free,
# in which case we add it to incidental.
if p.feature().incidental():
self.incidental_.append(p)
elif p.feature().free():
@@ -251,7 +241,7 @@ class PropertySet:
def base (self):
""" Returns properties that are neither incidental nor free.
"""
return self.base_raw_
return self.base_
def free (self):
""" Returns free properties which are not dependency properties.

View File

@@ -1019,7 +1019,7 @@ class BasicTarget (AbstractTarget):
if debug:
print " next alternative: required properties:", str(condition)
if b2.util.set.contains (condition, property_set.raw ()):
if b2.util.set.contains (condition, property_set.all()):
if debug:
print " matched"