aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2023-04-15 15:01:57 +0300
committerDylan Baker <dylan@pnwbakers.com>2023-04-19 15:12:21 -0700
commit45629466a7959d73576ea9c0b2eb6cce16169735 (patch)
tree3ad0b9a67ecf8448d5dbf7e7c10d90a89f89ed49 /mesonbuild
parent42e6c58441266916bc036bfae0c598b7595f6f86 (diff)
downloadmeson-45629466a7959d73576ea9c0b2eb6cce16169735.zip
meson-45629466a7959d73576ea9c0b2eb6cce16169735.tar.gz
meson-45629466a7959d73576ea9c0b2eb6cce16169735.tar.bz2
rust: Don't use prefer-dynamic in case of proc-macro Rust dependencies
They're only used at build-time and whether they exist or not should not have any effect on the final build artifact.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/ninjabackend.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 7fce48e..54cf07c 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2006,9 +2006,10 @@ class NinjaBackend(backends.Backend):
target_deps = target.get_dependencies()
has_shared_deps = any(isinstance(dep, build.SharedLibrary) for dep in target_deps)
if isinstance(target, build.SharedLibrary) or has_shared_deps:
- has_rust_shared_deps = any(isinstance(dep, build.SharedLibrary) and dep.uses_rust() and dep.rust_crate_type != 'cdylib'
+ has_rust_shared_deps = any(isinstance(dep, build.SharedLibrary) and dep.uses_rust()
+ and dep.rust_crate_type not in {'cdylib', 'proc-macro'}
for dep in target_deps)
- if cratetype != 'cdylib' or has_rust_shared_deps:
+ if cratetype not in {'cdylib', 'proc-macro'} or has_rust_shared_deps:
# add prefer-dynamic if any of the Rust libraries we link
# against are dynamic or this is a dynamic library itself,
# otherwise we'll end up with multiple implementations of crates