Skip to content

Commit

Permalink
do not duplicate external dependencies in list
Browse files Browse the repository at this point in the history
Since the "-l<lib>" flags in the build.ninja file are passed in
"--start-group"/"--end-group" flags, there should be no need to have any
library listed twice, even if there are circular dependencies. Therefore we
can eliminate duplicates. For speed, rather than deduplicating at the end
of the process, it's faster to not add the duplicate flags in the first
place.

This should help fix mesonbuild#2150
  • Loading branch information
bruce-richardson committed Mar 13, 2019
1 parent 5d3e209 commit 4793538
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mesonbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,9 @@ def add_deps(self, deps):
# Deps of deps.
self.add_deps(dep.ext_deps)
elif isinstance(dep, dependencies.Dependency):
self.external_deps.append(dep)
self.process_sourcelist(dep.get_sources())
if dep not in self.external_deps:
self.external_deps.append(dep)
self.process_sourcelist(dep.get_sources())
elif isinstance(dep, BuildTarget):
raise InvalidArguments('''Tried to use a build target as a dependency.
You probably should put it in link_with instead.''')
Expand Down

0 comments on commit 4793538

Please sign in to comment.