From 66eaa872f8b511955a09a8e39b7dbafd56d29ce5 Mon Sep 17 00:00:00 2001 From: Job Bautista Date: Sun, 26 Mar 2023 13:14:59 +0800 Subject: [PATCH] Issue #62 - Always build Spidermonkey as shared lib in Windows. Shared JS is confirmed working fine in Windows after a week of testing. Non-Windows will have to wait unfortunately. The JS_SHARED_LIBRARY option is kept for easy testing on those unsupported platforms. --- js/moz.configure | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/js/moz.configure b/js/moz.configure index 7687731f99..f632edafec 100644 --- a/js/moz.configure +++ b/js/moz.configure @@ -44,8 +44,11 @@ js_option('--disable-shared-js', default=building_js, js_option('--disable-export-js', default=building_js, help='Do not mark JS symbols as DLL exported/visible') -@depends('--disable-shared-js', '--disable-export-js') -def shared_js(shared_js, export_js): +@depends('--disable-shared-js', '--disable-export-js', target) +def shared_js(shared_js, export_js, target): + # We want shared JS always be enabled on Windows regardless of the enable bool. + if target.os == 'WINNT': + return True if shared_js: if not export_js: die('Must export JS symbols when building a shared library.') @@ -61,16 +64,18 @@ def exportable_js_api(shared_js, export_js): set_define('STATIC_EXPORTABLE_JS_API', exportable_js_api) -@depends('--disable-shared-js', '--disable-export-js') -def static_js_api(shared_js, export_js): - if not shared_js and not export_js: +@depends('--disable-shared-js', '--disable-export-js', target) +def static_js_api(shared_js, export_js, target): + # Do not build JS as a static library on Windows, regardless of enable bool. + if (target.os != 'WINNT') and not shared_js and not export_js: return True set_define('STATIC_JS_API', static_js_api) -@depends('--disable-shared-js') -def static_js(value): - if not value: +@depends('--disable-shared-js', target) +def static_js(value, target): + # Do not build JS as a static library on Windows, regardless of enable bool. + if (target.os != 'WINNT') and not value: return True set_define('MOZ_STATIC_JS', static_js)