[gjs: 7/15] build: Skip running minimal SpiderMonkey program on cross builds




commit a346d144a7d45147fdc24f8f106d8fc04a4128c7
Author: Philip Chimento <philip chimento gmail com>
Date:   Sun Nov 28 17:23:41 2021 -0800

    build: Skip running minimal SpiderMonkey program on cross builds
    
    We still try to build the program and get as far as we can even on cross
    builds, to eliminate problems with the way paths are set up, for example.
    
    For a cross build, we print a warning that builders should check that GJS
    works before shipping it, since we are not performing that check now.

 meson.build | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/meson.build b/meson.build
index 53715bd17..b3bf61ca2 100644
--- a/meson.build
+++ b/meson.build
@@ -265,11 +265,21 @@ int main(void) {
     args: debug_arg, dependencies: spidermonkey,
     name: 'SpiderMonkey sanity check')
 
-if not minimal_program.compiled() or minimal_program.returncode() != 0
+recommended_configuration = ''' Check the recommended configuration:
+https://github.com/spidermonkey-embedders/spidermonkey-embedding-examples/blob/esr78/docs/Building%20SpiderMonkey.md'''
+if not minimal_program.compiled()
     error('''A minimal SpiderMonkey program
-could not be compiled, linked, or run. Most likely you should build it with a
-different configuration. Check the recommended configuration:
-https://github.com/spidermonkey-embedders/spidermonkey-embedding-examples/blob/esr78/docs/Building%20SpiderMonkey.md''')
+could not be compiled or linked. Most likely you should build it with a
+different configuration.''' + recommended_configuration)
+elif meson.is_cross_build()
+    warning('''This is a cross build. A check that a minimal
+SpiderMonkey program executes will not be performed. Before shipping GJS, you
+should check that it does not crash on startup, since building SpiderMonkey with
+the wrong configuration may cause that.''' + recommended_configuration)
+elif minimal_program.returncode() != 0
+    error('''A minimal SpiderMonkey program
+failed to execute. Most likely you should build it with a different
+configuration.''' + recommended_configuration)
 endif
 
 have_printf_alternative_int = cc.compiles('''


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]