@@ -125,8 +125,9 @@ def read_macro_value(name, def_val = None):
125
125
raise ValueError (f"no { name } defined in jsb.config.h" )
126
126
127
127
use_quickjs = "quickjs" if env ["use_quickjs" ] else ("quickjs-ng" if env ["use_quickjs_ng" ] else None )
128
+ jsc_support = "jsc" if env ["use_jsc" ] and use_quickjs is None else None
128
129
quickjs_support = get_thirdparty_support (quickjs_src_descs , use_quickjs )
129
- v8_support = get_library_support (v8_prebuilt_libs ) if quickjs_support is None else None
130
+ v8_support = get_library_support (v8_prebuilt_libs ) if quickjs_support is None and jsc_support is None else None
130
131
lws_support = get_library_support (lws_prebuilt_libs )
131
132
132
133
jsb_defines = [
@@ -149,6 +150,11 @@ jsb_defines = [
149
150
"NOTE: web.impl is experimental and may not work as expected." ,
150
151
"NOTE: Obfuscation may not work in the current version. It'll be improved in the future versions. Report an issue if it breaks." ,
151
152
]),
153
+ CompileDefines ("JSB_WITH_JAVASCRIPTCORE" , 1 if jsc_support is not None else 0 , [
154
+ "Use JavaScriptCore as the javascript engine." ,
155
+ "NOTE: JavaScriptCore is only supported on macOS/iOS." ,
156
+ "NOTE: THIS FEATURE IS WORK-IN-PROGRESS, DO NOT USE IT." ,
157
+ ]),
152
158
153
159
CompileDefines ("JSB_WITH_EDITOR_UTILITY_FUNCS" , 1 if jsb_platform != "web" and env .editor_build else 0 , [
154
160
"Enables 'jsb.editor'" ,
@@ -477,6 +483,10 @@ if is_defined("JSB_WITH_WEB"):
477
483
env .AddJSPre ([ "impl/web/js/jsbb.impl.js" ])
478
484
env .AddJSLibraries ([ "impl/web/js/library_godotjs_jsbi.js" ])
479
485
486
+ if is_defined ("JSB_WITH_JAVASCRIPTCORE" ):
487
+ env_jsb .add_source_files (module_obj , "impl/jsc/*.cpp" )
488
+ env .Append (LINKFLAGS = [ "-framework" , "JavaScriptCore" ])
489
+
480
490
generate_code ([\
481
491
# presets for runtime
482
492
PresetDefine ("scripts/out/jsb.runtime.bundle.js" , "" , zero_terminated , AMDSourceTransformer ()),
0 commit comments