Allow test to depend on executable target in cross build. (#2007)

* Add a crossbuild case in 'test case/common/1 trivial/meson.build'

* Add native flags for crossbuild tests.
This commit is contained in:
FredericHamel 2017-07-20 05:25:59 -04:00 committed by Jussi Pakkanen
parent e89b6cdd10
commit 6f4e5e96d8
2 changed files with 7 additions and 0 deletions

View File

@ -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:

View File

@ -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