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.
pull/2089/head
FredericHamel 8 years ago committed by Jussi Pakkanen
parent e89b6cdd10
commit 6f4e5e96d8
  1. 2
      mesonbuild/backend/backends.py
  2. 5
      test cases/common/1 trivial/meson.build

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

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

Loading…
Cancel
Save