diff options
-rw-r--r-- | mesonbuild/backend/backends.py | 2 | ||||
-rw-r--r-- | test cases/common/1 trivial/meson.build | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index d2ea467..cadb655 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -506,6 +506,8 @@ class Backend: is_cross = self.environment.is_cross_build() and \ self.environment.cross_info.need_cross_compiler() and \ self.environment.cross_info.need_exe_wrapper() + if isinstance(exe, build.BuildTarget): + is_cross = is_cross and exe.is_cross if is_cross: exe_wrapper = self.environment.cross_info.config['binaries'].get('exe_wrapper', None) else: diff --git a/test cases/common/1 trivial/meson.build b/test cases/common/1 trivial/meson.build index a93de75..67d6ed6 100644 --- a/test cases/common/1 trivial/meson.build +++ b/test cases/common/1 trivial/meson.build @@ -11,6 +11,11 @@ if meson.get_compiler('c').get_id() == 'intel' add_project_arguments('-diag-error', '10159', language : 'c') endif +if meson.is_cross_build() + native_exe = executable('native-trivialprog', sources : sources, native : true) + test('native exe in cross build', native_exe) +endif + exe = executable('trivialprog', sources : sources) test('runtest', exe) # This is a comment |