mirror of https://gitlab.com/ita1024/waf.git
Optimizations
This commit is contained in:
parent
71e318e371
commit
5e4110443e
|
@ -211,9 +211,9 @@ class ConfigSet(object):
|
||||||
|
|
||||||
The value must be a list or a tuple
|
The value must be a list or a tuple
|
||||||
"""
|
"""
|
||||||
current_value = self._get_list_value_for_modification(var)
|
|
||||||
if isinstance(val, str): # if there were string everywhere we could optimize this
|
if isinstance(val, str): # if there were string everywhere we could optimize this
|
||||||
val = [val]
|
val = [val]
|
||||||
|
current_value = self._get_list_value_for_modification(var)
|
||||||
current_value.extend(val)
|
current_value.extend(val)
|
||||||
|
|
||||||
def prepend_value(self, var, val):
|
def prepend_value(self, var, val):
|
||||||
|
|
|
@ -409,19 +409,17 @@ def propagate_uselib_vars(self):
|
||||||
"""
|
"""
|
||||||
_vars = self.get_uselib_vars()
|
_vars = self.get_uselib_vars()
|
||||||
env = self.env
|
env = self.env
|
||||||
|
app = env.append_value
|
||||||
|
for var in _vars:
|
||||||
|
y = var.lower()
|
||||||
|
val = getattr(self, y, [])
|
||||||
|
if val:
|
||||||
|
app(var, val)
|
||||||
|
|
||||||
for x in _vars:
|
for x in self.features + self.uselib:
|
||||||
y = x.lower()
|
val = env['%s_%s' % (var, x)]
|
||||||
env.append_value(x, self.to_list(getattr(self, y, [])))
|
if val:
|
||||||
|
app(var, val)
|
||||||
for x in self.features:
|
|
||||||
for var in _vars:
|
|
||||||
compvar = '%s_%s' % (var, x)
|
|
||||||
env.append_value(var, env[compvar])
|
|
||||||
|
|
||||||
for x in self.to_list(getattr(self, 'uselib', [])):
|
|
||||||
for v in _vars:
|
|
||||||
env.append_value(v, env[v + '_' + x])
|
|
||||||
|
|
||||||
# ============ the code above must not know anything about import libs ==========
|
# ============ the code above must not know anything about import libs ==========
|
||||||
|
|
||||||
|
|
|
@ -213,6 +213,7 @@ def apply_uselib_local(self):
|
||||||
names = self.to_list(getattr(self, 'uselib_local', []))
|
names = self.to_list(getattr(self, 'uselib_local', []))
|
||||||
get = self.bld.get_tgen_by_name
|
get = self.bld.get_tgen_by_name
|
||||||
seen = set([])
|
seen = set([])
|
||||||
|
seen_uselib = set([])
|
||||||
tmp = Utils.deque(names) # consume a copy of the list of names
|
tmp = Utils.deque(names) # consume a copy of the list of names
|
||||||
if tmp:
|
if tmp:
|
||||||
if Logs.verbose:
|
if Logs.verbose:
|
||||||
|
@ -259,9 +260,11 @@ def apply_uselib_local(self):
|
||||||
|
|
||||||
# add ancestors uselib too - but only propagate those that have no staticlib defined
|
# add ancestors uselib too - but only propagate those that have no staticlib defined
|
||||||
for v in self.to_list(getattr(y, 'uselib', [])):
|
for v in self.to_list(getattr(y, 'uselib', [])):
|
||||||
if not env['STLIB_' + v]:
|
if v not in seen_uselib:
|
||||||
if not v in self.uselib:
|
seen_uselib.add(v)
|
||||||
self.uselib.insert(0, v)
|
if not env['STLIB_' + v]:
|
||||||
|
if not v in self.uselib:
|
||||||
|
self.uselib.insert(0, v)
|
||||||
|
|
||||||
# if the library task generator provides 'export_includes', add to the include path
|
# if the library task generator provides 'export_includes', add to the include path
|
||||||
# the export_includes must be a list of paths relative to the other library
|
# the export_includes must be a list of paths relative to the other library
|
||||||
|
|
Loading…
Reference in New Issue