1From 8a78a7996b01aba21377ceb7547da673fd30a391 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Wed, 27 Oct 2021 20:18:47 +0200
4Subject: [PATCH] Support cross builds a bit better
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9* Do not build/run mozjs-linked program
10* Do not try to run test applications
11
12Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/690]
13
14Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
15---
16 meson.build | 4 +++-
17 1 file changed, 3 insertions(+), 1 deletion(-)
18
19diff --git a/meson.build b/meson.build
20index c9b26d6..3058e8c 100644
21--- a/meson.build
22+++ b/meson.build
23@@ -262,6 +262,7 @@ release builds of SpiderMonkey. Try configuring SpiderMonkey with
24 --disable-debug.''')
25 endif
26
27+if not meson.is_cross_build()
28 # Check if a minimal SpiderMonkey program compiles, links, and runs. If not,
29 # it's most likely the case that SpiderMonkey was configured incorrectly, for
30 # example by building mozglue as a shared library.
31@@ -292,6 +293,7 @@ elif minimal_program.returncode() != 0
32 failed to execute. Most likely you should build it with a different
33 configuration.''' + recommended_configuration)
34 endif
35+endif # not meson.is_cross_build()
36
37 have_printf_alternative_int = cc.compiles('''
38 #include <stdio.h>
39@@ -690,7 +692,7 @@ subdir('installed-tests')
40
41 # Note: The test program in test/ needs to be ported
42 #       to Windows before we can build it on Windows.
43-if host_machine.system() != 'windows'
44+if host_machine.system() != 'windows' and not meson.is_cross_build()
45     subdir('test')
46 endif
47
48