don't create unneeded internal dependency objects

when flattening the chained dependencies of an object, we don't need to
create any new internal dependencies if all the fields to be added to it
are empty.

For projects with a lot of libraries and dependency objects this can lead
to noticeable performance improvements.

fixup
pull/3398/merge
Bruce Richardson 7 years ago committed by Nirbheek Chauhan
parent c213d715eb
commit 7806175c21
  1. 15
      mesonbuild/build.py

@ -855,13 +855,14 @@ This will become a hard error in a future Meson release.''')
self.link(l)
for l in dep.whole_libraries:
self.link_whole(l)
# Those parts that are external.
extpart = dependencies.InternalDependency('undefined',
[],
dep.compile_args,
dep.link_args,
[], [], [], [])
self.external_deps.append(extpart)
if dep.compile_args or dep.link_args:
# Those parts that are external.
extpart = dependencies.InternalDependency('undefined',
[],
dep.compile_args,
dep.link_args,
[], [], [], [])
self.external_deps.append(extpart)
# Deps of deps.
self.add_deps(dep.ext_deps)
elif isinstance(dep, dependencies.Dependency):

Loading…
Cancel
Save