diff options
Diffstat (limited to 'mesonbuild/compilers')
| -rw-r--r-- | mesonbuild/compilers/compilers.py | 6 | ||||
| -rw-r--r-- | mesonbuild/compilers/detect.py | 4 | ||||
| -rw-r--r-- | mesonbuild/compilers/rust.py | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index a73697cdd..9fbde0e49 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -521,6 +521,12 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta): def get_modes(self) -> T.List[Compiler]: return self.modes + def get_exe(self) -> str: + return self.exelist[0] + + def get_exe_args(self) -> T.List[str]: + return self.exelist[1:] + def get_linker_id(self) -> str: # There is not guarantee that we have a dynamic linker instance, as # some languages don't have separate linkers and compilers. In those diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index bce0be8a8..9dab06a85 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -1099,7 +1099,7 @@ def detect_rust_compiler(env: 'Environment', for_machine: MachineChoice) -> Rust extra_args: T.Dict[str, T.Union[str, bool]] = {} always_args: T.List[str] = [] if is_link_exe: - compiler.extend(cls.use_linker_args(cc.linker.exelist[0], '')) + compiler.extend(cls.use_linker_args(cc.linker.get_exe(), '')) extra_args['direct'] = True extra_args['machine'] = cc.linker.machine else: @@ -1131,7 +1131,7 @@ def detect_rust_compiler(env: 'Environment', for_machine: MachineChoice) -> Rust # inserts the correct prefix itself. assert isinstance(linker, linkers.VisualStudioLikeLinkerMixin) linker.direct = True - compiler.extend(cls.use_linker_args(linker.exelist[0], '')) + compiler.extend(cls.use_linker_args(linker.get_exe(), '')) else: # On linux and macos rust will invoke the c compiler for # linking, on windows it will use lld-link or link.exe. diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index 210544ed8..17908860e 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -314,7 +314,7 @@ class RustCompiler(Compiler): exelist = rustup_exelist + [name] else: exelist = [name] - args = self.exelist[1:] + args = self.get_exe_args() from ..programs import find_external_program for prog in find_external_program(env, self.for_machine, exelist[0], exelist[0], |
