diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2023-04-15 15:01:57 +0300 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2023-04-21 13:29:15 +0530 |
commit | d64092b1df6093d3e9eb460a4f87ad900ff5f9db (patch) | |
tree | c3ce0bb22e2830499703d7eb39f0360640ca8eba | |
parent | 35085adaf74b8c683fb82292f4095942efc8c204 (diff) | |
download | meson-d64092b1df6093d3e9eb460a4f87ad900ff5f9db.tar.gz |
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.
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 79e0510b8..b64fc2062 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1996,9 +1996,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 |