diff --git a/unity/cli/cmd.mjs b/unity/cli/cmd.mjs index 891313a39b..6c2df9af9f 100644 --- a/unity/cli/cmd.mjs +++ b/unity/cli/cmd.mjs @@ -36,6 +36,7 @@ program .option('-G, --generator ', 'cmake generator name') .option('-ts, --thread_safe', 'thread safe') .option('-wi, --with_inspector', 'with inspector') + .option('-jl, --jitless', 'jitless') .action(function (quickcommand, options) { let backend = options.backend; let config = options.config; diff --git a/unity/cli/make.mjs b/unity/cli/make.mjs index dff7e3f9e9..345ce68a59 100644 --- a/unity/cli/make.mjs +++ b/unity/cli/make.mjs @@ -269,6 +269,10 @@ async function runPuertsMake(cwd, options) { console.log('################################## thread_safe ##################################'); BackendConfig.definition.push("THREAD_SAFE"); } + if (options.jitless)) { + console.log('################################## jitless ##################################'); + BackendConfig.definition.push("JITLESS"); + } const definitionD = (BackendConfig.definition || []).join(';'); const linkD = (BackendConfig['link-libraries'][options.platform]?.[options.arch] || []).join(';'); const incD = (BackendConfig.include || []).join(';'); diff --git a/unity/native_src/Src/BackendEnv.cpp b/unity/native_src/Src/BackendEnv.cpp index baa7d53f73..73fe1c7dfc 100644 --- a/unity/native_src/Src/BackendEnv.cpp +++ b/unity/native_src/Src/BackendEnv.cpp @@ -225,11 +225,8 @@ void FBackendEnv::GlobalPrepare() std::string Flags = "--stack_size=856"; #if PUERTS_DEBUG Flags += " --expose-gc"; -#if PLATFORM_MAC - Flags += " --jitless --no-expose-wasm"; -#endif #endif -#if defined(PLATFORM_IOS) || defined(PLATFORM_OHOS) +#if defined(PLATFORM_IOS) || defined(PLATFORM_OHOS) || defined(JITLESS) Flags += " --jitless --no-expose-wasm"; #endif #if V8_MAJOR_VERSION <= 9