summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/backend/backends.py3
-rw-r--r--mesonbuild/compilers/cuda.py4
-rw-r--r--mesonbuild/compilers/d.py2
-rw-r--r--mesonbuild/compilers/mixins/clike.py4
-rw-r--r--mesonbuild/compilers/rust.py2
5 files changed, 8 insertions, 7 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index c6fe4f0a9..8c4003b73 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -570,7 +570,8 @@ class Backend:
else:
extra_paths = []
- if self.environment.need_exe_wrapper(exe_for_machine):
+ is_cross_built = not self.environment.machines.matches_build_machine(exe_for_machine)
+ if is_cross_built and self.environment.need_exe_wrapper():
if not self.environment.has_exe_wrapper():
msg = 'An exe_wrapper is needed but was not found. Please define one ' \
'in cross file and check the command and/or add it to PATH.'
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
index 9af15422b..2fd6d17c9 100644
--- a/mesonbuild/compilers/cuda.py
+++ b/mesonbuild/compilers/cuda.py
@@ -553,7 +553,7 @@ class CudaCompiler(Compiler):
flags += self.get_ccbin_args(env.coredata.optstore)
# If cross-compiling, we can't run the sanity check, only compile it.
- if env.need_exe_wrapper(self.for_machine) and not env.has_exe_wrapper():
+ if self.is_cross and not env.has_exe_wrapper():
# Linking cross built apps is painful. You can't really
# tell if you should use -nostdlib or not and for example
# on OSX the compiler binary is the same but you need
@@ -575,7 +575,7 @@ class CudaCompiler(Compiler):
raise EnvironmentException(f'Compiler {self.name_string()} cannot compile programs.')
# Run sanity check (if possible)
- if env.need_exe_wrapper(self.for_machine):
+ if self.is_cross:
if not env.has_exe_wrapper():
return
else:
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index 9420d7af3..67aa2b1eb 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -456,7 +456,7 @@ class DCompiler(Compiler):
if pc.returncode != 0:
raise EnvironmentException('D compiler %s cannot compile programs.' % self.name_string())
- if environment.need_exe_wrapper(self.for_machine):
+ if self.is_cross:
if not environment.has_exe_wrapper():
# Can't check if the binaries run so we have to assume they do
return
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index 70e81a4b8..1fddb0f95 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -278,7 +278,7 @@ class CLikeCompiler(Compiler):
mode = CompileCheckMode.LINK
if self.is_cross:
binname += '_cross'
- if environment.need_exe_wrapper(self.for_machine) and not environment.has_exe_wrapper():
+ if not environment.has_exe_wrapper():
# Linking cross built C/C++ apps is painful. You can't really
# tell if you should use -nostdlib or not and for example
# on OSX the compiler binary is the same but you need
@@ -308,7 +308,7 @@ class CLikeCompiler(Compiler):
if pc.returncode != 0:
raise mesonlib.EnvironmentException(f'Compiler {self.name_string()} cannot compile programs.')
# Run sanity check
- if environment.need_exe_wrapper(self.for_machine):
+ if self.is_cross:
if not environment.has_exe_wrapper():
# Can't check if the binaries run so we have to assume they do
return
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py
index 7bcab3ab4..d071559da 100644
--- a/mesonbuild/compilers/rust.py
+++ b/mesonbuild/compilers/rust.py
@@ -87,7 +87,7 @@ class RustCompiler(Compiler):
if pc.returncode != 0:
raise EnvironmentException(f'Rust compiler {self.name_string()} cannot compile programs.')
self._native_static_libs(work_dir, source_name)
- if environment.need_exe_wrapper(self.for_machine):
+ if self.is_cross:
if not environment.has_exe_wrapper():
# Can't check if the binaries run so we have to assume they do
return