From c0765b0e8da6ad699b02dcc19a6480b3e6f71655 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 14 Apr 2016 22:52:15 +0530 Subject: Don't require an exe_wrapper when cross-compiling 32-bit on 64-bit Almost all 64-bit x86 OSes can run 32-bit x86 binaries natively. Detect that case and don't require an exe wrapper. --- mesonbuild/backend/backends.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mesonbuild/backend/backends.py') diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index ceb466b..b7a2c30 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -315,7 +315,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: @@ -366,8 +368,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 -- cgit v1.1