diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-30 23:38:28 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-06-02 05:32:16 +0530 |
commit | 6963da616bc26708061878788240dbbb11cddc39 (patch) | |
tree | 53c1929167f9f7be7763d8c12706d215754a2ae0 /mesonbuild/backend/backends.py | |
parent | 6662f36ed36b9fbee700993fa24ca99250161873 (diff) | |
download | meson-6963da616bc26708061878788240dbbb11cddc39.zip meson-6963da616bc26708061878788240dbbb11cddc39.tar.gz meson-6963da616bc26708061878788240dbbb11cddc39.tar.bz2 |
Don't add dependencies recursively while linking
We were doing this on the basis of an old comment, but there was no
test for it and I couldn't reproduce the issue with clang on Linux
at all.
Let's add a (somewhat comprehensive) test and see if it breaks
anywhere if we stop doing this.
Halves the size of gstreamer's build.ninja from 20M to 8.7M
Closes https://github.com/mesonbuild/meson/issues/1057
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 4cfdd9e..3044ce6 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -453,15 +453,11 @@ class Backend: for d in deps: if not isinstance(d, (build.StaticLibrary, build.SharedLibrary)): raise RuntimeError('Tried to link with a non-library target "%s".' % d.get_basename()) - if isinstance(compiler, compilers.LLVMDCompiler) or isinstance(compiler, compilers.DmdDCompiler): - args += ['-L' + self.get_target_filename_for_linking(d)] + if isinstance(compiler, (compilers.LLVMDCompiler, compilers.DmdDCompiler)): + d_arg = '-L' + self.get_target_filename_for_linking(d) else: - args.append(self.get_target_filename_for_linking(d)) - # If you have executable e that links to shared lib s1 that links to shared library s2 - # you have to specify s2 as well as s1 when linking e even if e does not directly use - # s2. Gcc handles this case fine but Clang does not for some reason. Thus we need to - # explictly specify all libraries every time. - args += self.build_target_link_arguments(compiler, d.get_dependencies()) + d_arg = self.get_target_filename_for_linking(d) + args.append(d_arg) return args def determine_windows_extra_paths(self, target): |