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