diff --git a/waflib/ConfigSet.py b/waflib/ConfigSet.py index 32c28a5d..de0c3aee 100644 --- a/waflib/ConfigSet.py +++ b/waflib/ConfigSet.py @@ -211,9 +211,9 @@ class ConfigSet(object): 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 val = [val] + current_value = self._get_list_value_for_modification(var) current_value.extend(val) def prepend_value(self, var, val): diff --git a/waflib/Tools/ccroot.py b/waflib/Tools/ccroot.py index 0dc0c7ba..d4ef200c 100644 --- a/waflib/Tools/ccroot.py +++ b/waflib/Tools/ccroot.py @@ -409,19 +409,17 @@ def propagate_uselib_vars(self): """ _vars = self.get_uselib_vars() 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: - y = x.lower() - env.append_value(x, self.to_list(getattr(self, y, []))) - - 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]) + for x in self.features + self.uselib: + val = env['%s_%s' % (var, x)] + if val: + app(var, val) # ============ the code above must not know anything about import libs ========== diff --git a/waflib/extras/compat15.py b/waflib/extras/compat15.py index efbadd1b..4cfc4994 100644 --- a/waflib/extras/compat15.py +++ b/waflib/extras/compat15.py @@ -213,6 +213,7 @@ def apply_uselib_local(self): names = self.to_list(getattr(self, 'uselib_local', [])) get = self.bld.get_tgen_by_name seen = set([]) + seen_uselib = set([]) tmp = Utils.deque(names) # consume a copy of the list of names if tmp: 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 for v in self.to_list(getattr(y, 'uselib', [])): - if not env['STLIB_' + v]: - if not v in self.uselib: - self.uselib.insert(0, v) + if v not in seen_uselib: + seen_uselib.add(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 # the export_includes must be a list of paths relative to the other library