diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-10-26 09:15:54 +0100 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-12-22 12:01:05 +0100 |
| commit | 254d7e1c48f3a2d0837439f07628cfd54e47367b (patch) | |
| tree | 7c5deb63b2c3ae70db943d450d123e60645c9f78 /mesonbuild/compilers/rust.py | |
| parent | 2a5370fa85397473e98a09779fc4c7a56e048959 (diff) | |
| download | meson-254d7e1c48f3a2d0837439f07628cfd54e47367b.tar.gz | |
rust: add to_system_dependency
Move the logic for system dependencies outside Cargo.interpreter and
into the rust module, so that it can be reused by the workspace object.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/compilers/rust.py')
| -rw-r--r-- | mesonbuild/compilers/rust.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index ab0706d26..7ad7f34e9 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -11,6 +11,7 @@ import re import typing as T from .. import options +from ..dependencies import InternalDependency from ..mesonlib import EnvironmentException, MesonException, Popen_safe_logged, version_compare from ..linkers.linkers import VisualStudioLikeLinkerMixin from ..options import OptionKey @@ -73,6 +74,11 @@ def rustc_link_args(args: T.List[str]) -> T.List[str]: rustc_args.append(f'link-arg={arg}') return rustc_args + +class RustSystemDependency(InternalDependency): + pass + + class RustCompiler(Compiler): # rustc doesn't invoke the compiler itself, it doesn't need a LINKER_PREFIX @@ -323,6 +329,8 @@ class RustCompiler(Compiler): return opts def get_dependency_compile_args(self, dep: 'Dependency') -> T.List[str]: + if isinstance(dep, RustSystemDependency): + return dep.get_compile_args() # Rust doesn't have dependency compile arguments so simply return # nothing here. Dependencies are linked and all required metadata is # provided by the linker flags. |
