summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-11-27 15:47:16 -0500
committerXavier Claessens <xclaesse@gmail.com>2024-03-15 11:38:54 -0400
commitc1076241af11f10acac28d771688bb54c6b0b340 (patch)
tree337ac789c919fac824f36807f02874396ce669ce /mesonbuild/compilers/compilers.py
parent6b569527bca9354be77769f91a0607cfd692d861 (diff)
downloadmeson-c1076241af11f10acac28d771688bb54c6b0b340.tar.gz
compilers: No need to pass exe_wrapper everywhere
Places where compiler needs it already have access to Environment object and can use it directly. This fixes mypy complaining that not all compilers have self.exe_wrapper in run() method that got moved to base class.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 474c87eb5..9e99706c0 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -629,14 +629,14 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
run_env: T.Optional[T.Dict[str, str]] = None,
run_cwd: T.Optional[str] = None) -> RunResult:
need_exe_wrapper = env.need_exe_wrapper(self.for_machine)
- if need_exe_wrapper and self.exe_wrapper is None:
+ if need_exe_wrapper and not env.has_exe_wrapper():
raise CrossNoRunException('Can not run test applications in this cross environment.')
with self._build_wrapper(code, env, extra_args, dependencies, mode=CompileCheckMode.LINK, want_output=True) as p:
if p.returncode != 0:
mlog.debug(f'Could not compile test file {p.input_name}: {p.returncode}\n')
return RunResult(False)
if need_exe_wrapper:
- cmdlist = self.exe_wrapper.get_command() + [p.output_name]
+ cmdlist = env.exe_wrapper.get_command() + [p.output_name]
else:
cmdlist = [p.output_name]
try: