Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 1 | From fa47185d9c8150a0dcb0ea12b92fcf139edbef35 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> |
| 15 | --- |
| 16 | meson.build | 4 +++- |
| 17 | 1 file changed, 3 insertions(+), 1 deletion(-) |
| 18 | |
| 19 | diff --git a/meson.build b/meson.build |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 20 | index 136e812..f5b91e0 100644 |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 21 | --- a/meson.build |
| 22 | +++ b/meson.build |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 23 | @@ -252,6 +252,7 @@ release builds of SpiderMonkey. Try configuring SpiderMonkey with |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 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. |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 31 | @@ -282,6 +283,7 @@ elif minimal_program.returncode() != 0 |
| 32 | failed to execute. Most likely you should build it with a different |
| 33 | configuration.''' + recommended_configuration) |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 34 | endif |
| 35 | +endif # not meson.is_cross_build() |
| 36 | |
| 37 | have_printf_alternative_int = cc.compiles(''' |
| 38 | #include <stdio.h> |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 39 | @@ -682,7 +684,7 @@ subdir('installed-tests') |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 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 | |