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