From 2f427fa1e0a1ab9753b34c3b1389b02ef0e42bfa Mon Sep 17 00:00:00 2001 From: johnche Date: Tue, 31 Dec 2024 11:32:53 +0800 Subject: [PATCH] =?UTF-8?q?[unity]mac=20debug=E7=89=88=E6=9C=AC=E6=89=93?= =?UTF-8?q?=E5=BC=80jit=EF=BC=8Ccli=E6=9E=84=E5=BB=BA=E6=B7=BB=E5=8A=A0jit?= =?UTF-8?q?less=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unity/cli/cmd.mjs | 1 + unity/cli/make.mjs | 4 ++++ unity/native_src/Src/BackendEnv.cpp | 5 +---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/unity/cli/cmd.mjs b/unity/cli/cmd.mjs index 891313a39be..6c2df9af9f2 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 dff7e3f9e98..345ce68a59e 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 baa7d53f739..73fe1c7dfc4 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