diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-11-13 11:35:30 -0800 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-11-19 10:48:48 -0800 |
| commit | 802a9f6b522a1f48f48ed1cd6a598eabe90e699a (patch) | |
| tree | 31d1d7b98a9c4d568c1c360bde42d0ea5ea3c95a | |
| parent | 68b959c2c7a2cfb88ebf2205f25bf77abe318cb9 (diff) | |
| download | meson-802a9f6b522a1f48f48ed1cd6a598eabe90e699a.tar.gz | |
compilers: Remove Environment parameter from RustCompiler.lib_file_to_l_args
| -rw-r--r-- | mesonbuild/backend/ninjabackend.py | 2 | ||||
| -rw-r--r-- | mesonbuild/compilers/rust.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index f7e17bde6..00db7a206 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2065,7 +2065,7 @@ class NinjaBackend(backends.Backend): if rustc.has_verbatim(): modifiers.append('+verbatim') else: - libname = rustc.lib_file_to_l_arg(self.environment, libname) + libname = rustc.lib_file_to_l_arg(libname) if libname is None: raise MesonException(f"rustc does not implement '-l{type_}:+verbatim'; cannot link to '{orig_libname}' due to nonstandard name") diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index b214a218d..3eb20500e 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -240,7 +240,7 @@ class RustCompiler(Compiler): # being linked. However, Meson uses "bundle", not "whole_archive". return False - def lib_file_to_l_arg(self, env: Environment, libname: str) -> T.Optional[str]: + def lib_file_to_l_arg(self, libname: str) -> T.Optional[str]: """Undo the effects of -l on the filename, returning the argument that can be passed to -l, or None if the library name is not supported.""" @@ -251,7 +251,7 @@ class RustCompiler(Compiler): # On Windows, rustc's -lfoo searches either foo.lib or libfoo.a. # Elsewhere, it searches both static and shared libraries and always with # the "lib" prefix; for simplicity just skip .lib on non-Windows. - if env.machines[self.for_machine].is_windows(): + if self.info.is_windows(): if ext == '.lib': return libname if ext != '.a': |
