diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2024-03-04 16:01:04 -0500 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2024-03-05 09:18:32 -0500 |
commit | 5e0a3073dad6ec4c4bdbccb755338f01b805fe53 (patch) | |
tree | 0ca4024c3db769585dfb8fd0394b109f216910fe /mesonbuild/backend | |
parent | a9d42a7c1e567fb18f835c9f352c0b0efad8391b (diff) | |
download | meson-5e0a3073dad6ec4c4bdbccb755338f01b805fe53.zip meson-5e0a3073dad6ec4c4bdbccb755338f01b805fe53.tar.gz meson-5e0a3073dad6ec4c4bdbccb755338f01b805fe53.tar.bz2 |
rust: Link with rlib external dependencies
When linking with a Rust rlib, we should also link with its external
system dependencies. This was currently done only for C ABI crates, do
it for both rlib and staticlib now.
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 74994d0..f665e61 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1979,6 +1979,8 @@ class NinjaBackend(backends.Backend): for d in target_deps: linkdirs.add(d.subdir) deps.append(self.get_dependency_filename(d)) + if isinstance(d, build.StaticLibrary): + external_deps.extend(d.external_deps) if d.uses_rust_abi(): if d not in itertools.chain(target.link_targets, target.link_whole_targets): # Indirect Rust ABI dependency, we only need its path in linkdirs. @@ -1993,9 +1995,6 @@ class NinjaBackend(backends.Backend): # Link a C ABI library - if isinstance(d, build.StaticLibrary): - external_deps.extend(d.external_deps) - # Pass native libraries directly to the linker with "-C link-arg" # because rustc's "-l:+verbatim=" is not portable and we cannot rely # on linker to find the right library without using verbatim filename. |