diff options
| author | Bruce Richardson <bruce.richardson@intel.com> | 2018-04-12 15:33:49 +0100 |
|---|---|---|
| committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-04-13 01:04:38 +0000 |
| commit | 7806175c218d079bd2b608f96a902c6fcd17334d (patch) | |
| tree | 05658cb758bfdd5ea1fb1c1d7f373264f1193ed3 | |
| parent | c213d715ebb594c52425d361409aa28d13b77d9a (diff) | |
| download | meson-7806175c218d079bd2b608f96a902c6fcd17334d.tar.gz | |
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
| -rw-r--r-- | mesonbuild/build.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 87ce8a586..8d16c95ba 100644 --- a/mesonbuild/build.py +++ b/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): |
