diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py index 816f6a0..42902a3 100644 --- a/pylib/gyp/generator/make.py +++ b/pylib/gyp/generator/make.py @@ -511,7 +511,7 @@ def Sourceify(path): # Map from qualified target to path to output. target_outputs = {} -# Map from qualified target to a list of linkable outputs. A subset +# Map from qualified target to any linkable output. A subset # of target_outputs. E.g. when mybinary depends on liba, we want to # include liba in the linker line; when otherbinary depends on # mybinary, we just want to build mybinary first. @@ -620,7 +620,7 @@ def Write(self, qualified_target, base_path, output_filename, spec, configs, # Update global list of link dependencies. if self.type in ('static_library', 'shared_library'): - target_link_deps[qualified_target] = [self.output] + target_link_deps[qualified_target] = self.output # Currently any versions have the same effect, but in future the behavior # could be different. @@ -982,7 +982,7 @@ def ComputeDeps(self, spec): if target_outputs[dep]]) for dep in spec['dependencies']: if dep in target_link_deps: - link_deps.extend(target_link_deps[dep]) + link_deps.append(target_link_deps[dep]) deps.extend(link_deps) # TODO: It seems we need to transitively link in libraries (e.g. -lfoo)? # This hack makes it work: diff --git a/pylib/gyp/input.py b/pylib/gyp/input.py index 5bc8cb4..3fe7bc5 100644 --- a/pylib/gyp/input.py +++ b/pylib/gyp/input.py @@ -1545,14 +1545,6 @@ def AdjustStaticLibraryDependencies(flat_list, targets, dependency_nodes): target_dict['dependencies'] = [] if not dependency in target_dict['dependencies']: target_dict['dependencies'].append(dependency) - # Sort the dependencies list in the order from dependents to dependencies. - # e.g. If A and B depend on C and C depends on D, sort them in A, B, C, D. - # Note: flat_list is already sorted in the order from dependencies to - # dependents. - if 'dependencies' in target_dict: - target_dict['dependencies'] = [ - dep for dep in flat_list if dep in target_dict['dependencies']] - target_dict['dependencies'].reverse() # Initialize this here to speed up MakePathRelative. exception_re = re.compile(r'''["']?[-/$<>]''')