diff options
author | FredericHamel <frederic.hamel123@gmail.com> | 2017-07-20 05:25:59 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-07-20 12:25:59 +0300 |
commit | 6f4e5e96d87b4f28b0f2fc92edb854d1fd81cfdc (patch) | |
tree | 647e6bf291ccb7cb4e8df06e1c693e592935eb2b | |
parent | e89b6cdd1037d4c7cfdcb37555f2cbaf66f6ae05 (diff) | |
download | meson-6f4e5e96d87b4f28b0f2fc92edb854d1fd81cfdc.zip meson-6f4e5e96d87b4f28b0f2fc92edb854d1fd81cfdc.tar.gz meson-6f4e5e96d87b4f28b0f2fc92edb854d1fd81cfdc.tar.bz2 |
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.
-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 |