diff --git a/v2/build/property.py b/v2/build/property.py index 633301d60..d3ed168d4 100644 --- a/v2/build/property.py +++ b/v2/build/property.py @@ -26,12 +26,15 @@ class Property(object): __slots__ = ('_feature', '_value', '_condition') - def __init__(self, feature, value, condition = []): - assert(feature.free() or value.find(':') == -1) - self._feature = feature + def __init__(self, f, value, condition = []): + if type(f) == type(""): + f = feature.get(f) + # At present, single property has a single value. + assert type(value) != type([]) + assert(f.free() or value.find(':') == -1) + self._feature = f self._value = value self._condition = condition - def feature(self): return self._feature diff --git a/v2/build/virtual_target.py b/v2/build/virtual_target.py index a7060123f..2e67a53f3 100644 --- a/v2/build/virtual_target.py +++ b/v2/build/virtual_target.py @@ -879,7 +879,7 @@ class NullAction (Action): actions which create them. """ def __init__ (self, manager, prop_set): - Action.__init__ (self, manager, None, None, prop_set) + Action.__init__ (self, manager, [], None, prop_set) def actualize (self): if not self.actualized_: diff --git a/v2/test/searched_lib.py b/v2/test/searched_lib.py index 4d6d5f198..48d636609 100644 --- a/v2/test/searched_lib.py +++ b/v2/test/searched_lib.py @@ -46,7 +46,7 @@ t.write("jamfile.jam", """ import path ; import project ; -local here = [ project.attribute $(__name__) location ] ; +path-constant here : . ; here = [ path.root $(here) [ path.pwd ] ] ; exe main : main.cpp helper ; diff --git a/v2/tools/builtin.py b/v2/tools/builtin.py index cfe475332..bd3594721 100644 --- a/v2/tools/builtin.py +++ b/v2/tools/builtin.py @@ -336,7 +336,7 @@ class SearchedLibTarget (virtual_target.AbstractFileTarget): return self.search_ def actualize_location (self, target): - project.manager ().engine ().add_not_file_target (target) + bjam.call("NOTFILE", target) def path (self): #FIXME: several functions rely on this not being None @@ -578,19 +578,21 @@ class LinkingGenerator (generators.Generator): generators.Generator.__init__ (self, id, composing, source_types, target_types_and_names, requirements) def run (self, project, name, prop_set, sources): + lib_sources = prop_set.get('') - [ sources.append (project.manager().get_object(x)) for x in lib_sources ] + sources.extend(lib_sources) # Add properties for all searched libraries extra = [] for s in sources: if s.type () == 'SEARCHED_LIB': search = s.search() - extra.append(replace_grist(search, '')) + extra.extend(property.Property('', sp) for sp in search) orig_xdll_path = [] - if prop_set.get('') == ['true'] and type.is_derived(self.target_types_ [0], 'EXE'): + if prop_set.get('') == ['true'] \ + and type.is_derived(self.target_types_ [0], 'EXE'): xdll_path = prop_set.get('') orig_xdll_path = [ replace_grist(x, '') for x in xdll_path ] # It's possible that we have libraries in sources which did not came @@ -670,12 +672,12 @@ class LinkingGenerator (generators.Generator): fst = [] for s in sources: if type.is_derived(s.type(), 'SEARCHED_LIB'): - name = s.real_name() + n = s.real_name() if s.shared(): - fsa.append(name) + fsa.append(n) else: - fst.append(name) + fst.append(n) else: sources2.append(s) @@ -685,9 +687,8 @@ class LinkingGenerator (generators.Generator): add.append("" + '&&'.join(fsa)) if fst: add.append("" + '&&'.join(fst)) - - spawn = generators.Generator.generated_targets(self, sources2,prop_set.add_raw(add), project, name) - + + spawn = generators.Generator.generated_targets(self, sources2, prop_set.add_raw(add), project, name) return spawn