summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-05-13 14:02:29 +0200
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-05-13 15:58:26 +0000
commitd526af89ca0e52fa076a805e4f585d16dbd1562a (patch)
tree00f7b3a9fa337f9845a9a87a895cf065a8929625
parentab6a410426d614f95b779797f3dfb289eb3672d9 (diff)
downloadmeson-d526af89ca0e52fa076a805e4f585d16dbd1562a.tar.gz
interpretor: Do not add dependencies if we already have them
in tree like dep structures with a lot of source: declarations, this can result in a lot of presure on the source list. this saves ~3s out of 7s in the interpretor stage in efl build.
-rw-r--r--mesonbuild/build.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 2b4b1b980..2ba7c594b 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -497,6 +497,7 @@ class BuildTarget(Target):
self.link_targets = []
self.link_whole_targets = []
self.link_depends = []
+ self.added_deps = set()
self.name_prefix_set = False
self.name_suffix_set = False
self.filename = 'no_name'
@@ -1053,6 +1054,8 @@ This will become a hard error in a future Meson release.''')
def add_deps(self, deps):
deps = listify(deps)
for dep in unholder(deps):
+ if dep in self.added_deps:
+ continue
if isinstance(dep, dependencies.InternalDependency):
# Those parts that are internal.
self.process_sourcelist(dep.sources)
@@ -1091,6 +1094,7 @@ You probably should put it in link_with instead.''')
'either an external dependency (returned by find_library() or '
'dependency()) or an internal dependency (returned by '
'declare_dependency()).'.format(type(dep).__name__))
+ self.added_deps.add(dep)
def get_external_deps(self):
return self.external_deps