aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/backends.py9
-rw-r--r--mesonbuild/backend/ninjabackend.py8
2 files changed, 11 insertions, 6 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 19f50ad..7c6caa6 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -357,7 +357,9 @@ class Backend():
fname = exe.fullpath
else:
fname = [os.path.join(self.environment.get_build_dir(), self.get_target_filename(t.get_exe()))]
- is_cross = self.environment.is_cross_build() and self.environment.cross_info.need_cross_compiler()
+ is_cross = self.environment.is_cross_build() and \
+ self.environment.cross_info.need_cross_compiler() and \
+ self.environment.cross_info.need_exe_wrapper()
if is_cross:
exe_wrapper = self.environment.cross_info.config['binaries'].get('exe_wrapper', None)
else:
@@ -408,8 +410,9 @@ class Backend():
def exe_object_to_cmd_array(self, exe):
if self.environment.is_cross_build() and \
- isinstance(exe, build.BuildTarget) and exe.is_cross:
- if 'exe_wrapper' not in self.environment.cross_info:
+ self.environment.cross_info.need_exe_wrapper() and \
+ isinstance(exe, build.BuildTarget) and exe.is_cross:
+ if 'exe_wrapper' not in self.environment.cross_info.config:
s = 'Can not use target %s as a generator because it is cross-built\n'
s += 'and no exe wrapper is defined. You might want to set it to native instead.'
s = s % exe.name
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 5a21a6c..ce8968c 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -409,9 +409,11 @@ int dummy;
if isinstance(texe, build.Executable):
abs_exe = os.path.join(self.environment.get_build_dir(), self.get_target_filename(texe))
deps.append(self.get_target_filename(texe))
- if self.environment.is_cross_build() \
- and self.environment.cross_info.config['binaries'].get('exe_wrapper', None) is not None:
- cmd += [self.environment.cross_info.config['binaries']['exe_wrapper']]
+ if self.environment.is_cross_build() and \
+ self.environment.cross_info.need_exe_wrapper():
+ exe_wrap = self.environment.cross_info.config['binaries'].get('exe_wrapper', None)
+ if exe_wrap is not None:
+ cmd += [exe_wrap]
cmd.append(abs_exe)
else:
cmd.append(target.command)