blob: db08b5af55527e62cedd73428b159df3a9412ca1 [file] [log] [blame]
Patrick Williams7784c422022-11-17 07:29:11 -06001From fdbffaea2fa85c203cc6aacb5734acac65aeaa19 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Fri, 11 Nov 2022 13:12:42 +0100
4Subject: [PATCH] tests/meson.build: do not use can_run_host_binaries()
5
6can_run_host_binaries() returns true even when cross compiling,
7if there is an executable wrapper defined that can run
8cross-binaries under some kind of emulation.
9
10Unfortunately, custom_target() will not use the wrapper
11and will attempt to execute the command directly. Until
12this is addressed in meson upstream, we have to disable
13these targets in cross scenarios.
14
15Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3067]
16Signed-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
23diff --git a/gio/tests/meson.build b/gio/tests/meson.build
24index 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
36diff --git a/glib/tests/meson.build b/glib/tests/meson.build
37index 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',