Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame^] | 1 | From fdbffaea2fa85c203cc6aacb5734acac65aeaa19 Mon Sep 17 00:00:00 2001 |
| 2 | From: Alexander Kanavin <alex@linutronix.de> |
| 3 | Date: Fri, 11 Nov 2022 13:12:42 +0100 |
| 4 | Subject: [PATCH] tests/meson.build: do not use can_run_host_binaries() |
| 5 | |
| 6 | can_run_host_binaries() returns true even when cross compiling, |
| 7 | if there is an executable wrapper defined that can run |
| 8 | cross-binaries under some kind of emulation. |
| 9 | |
| 10 | Unfortunately, custom_target() will not use the wrapper |
| 11 | and will attempt to execute the command directly. Until |
| 12 | this is addressed in meson upstream, we have to disable |
| 13 | these targets in cross scenarios. |
| 14 | |
| 15 | Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3067] |
| 16 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> |
| 17 | |
| 18 | --- |
| 19 | gio/tests/meson.build | 2 +- |
| 20 | glib/tests/meson.build | 2 +- |
| 21 | 2 files changed, 2 insertions(+), 2 deletions(-) |
| 22 | |
| 23 | diff --git a/gio/tests/meson.build b/gio/tests/meson.build |
| 24 | index 49cfa25ce..ea59656f9 100644 |
| 25 | --- a/gio/tests/meson.build |
| 26 | +++ b/gio/tests/meson.build |
| 27 | @@ -652,7 +652,7 @@ if installed_tests_enabled |
| 28 | endforeach |
| 29 | endif |
| 30 | |
| 31 | -if meson.can_run_host_binaries() |
| 32 | +if not meson.is_cross_build() |
| 33 | |
| 34 | compiler_type = '--compiler=@0@'.format(cc.get_id()) |
| 35 | |
| 36 | diff --git a/glib/tests/meson.build b/glib/tests/meson.build |
| 37 | index 69508178e..e4f75f302 100644 |
| 38 | --- a/glib/tests/meson.build |
| 39 | +++ b/glib/tests/meson.build |
| 40 | @@ -411,7 +411,7 @@ executable('testing-helper', 'testing-helper.c', |
| 41 | ) |
| 42 | |
| 43 | # some testing of gtester functionality |
| 44 | -if meson.can_run_host_binaries() and host_system != 'windows' |
| 45 | +if not meson.is_cross_build() and host_system != 'windows' |
| 46 | xmllint = find_program('xmllint', required: false) |
| 47 | if xmllint.found() |
| 48 | tmpsample_xml = custom_target('tmpsample.xml', |