diff options
author | Bruce Richardson <bruce.richardson@intel.com> | 2019-03-13 10:13:55 +0000 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2019-03-13 11:54:39 +0000 |
commit | cfe82db5ab0d35832da474014dff4b6dfe33f8b7 (patch) | |
tree | 74abc1e83e6fc7db09803f3b6b61bd0aa60bc4f2 /mesonbuild/build.py | |
parent | 5d3e20984dadefb122e9e4fae584b40d936844e8 (diff) | |
download | meson-cfe82db5ab0d35832da474014dff4b6dfe33f8b7.zip meson-cfe82db5ab0d35832da474014dff4b6dfe33f8b7.tar.gz meson-cfe82db5ab0d35832da474014dff4b6dfe33f8b7.tar.bz2 |
do not duplicate external dependencies in list
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 #2150
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index d456ab8..20f0cdb 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1030,8 +1030,9 @@ This will become a hard error in a future Meson release.''') # 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.''') |