From f295d0468e1dc2f23a8a3b2d76ea0fd9f1537e68 Mon Sep 17 00:00:00 2001 From: RingKing <1300547600@qq.com> Date: Sat, 8 Oct 2022 14:50:34 +0800 Subject: [PATCH] fixed 07beb59 from https://gitee.com/ring_king/third_party_jerryscript/pulls/92 modify jerry Signed-off-by: RingKing <1300547600@qq.com> --- BUILD.gn | 5 ++++- bundle.json | 2 +- engine.gni | 4 ++++ jerry-core/BUILD.gn | 4 +++- jerry-ext/BUILD.gn | 4 +++- jerry-port/default/BUILD.gn | 4 +++- 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index bffca4ab..dbf364a1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -26,6 +26,7 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera } } else { import("//build/ohos.gni") + import("//third_party/jerryscript/engine.gni") config("jerryscript_config") { defines = [ "JERRY_SNAPSHOT_SAVE=1", @@ -47,7 +48,6 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera "JERRY_CPOINTER_32_BIT=0", "JERRY_DEBUGGER=1", "JERRY_ES2015=0", - "JERRY_EXTERNAL_CONTEXT=1", "JERRY_FUNCTION_BACKTRACE", "JERRY_FUNCTION_NAME", "JERRY_GC_LIMIT=(0)", @@ -65,6 +65,9 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera "JERRY_VALGRIND=0", "JERRY_VM_EXEC_STOP=0", ] + if (thirdparty_jerryscript_enable_external_context == true) { + defines += [ "JERRY_EXTERNAL_CONTEXT=1" ] + } cflags = [ "-Wno-unused-function", "-Wno-sign-compare", diff --git a/bundle.json b/bundle.json index 4b3076e5..747e5b43 100644 --- a/bundle.json +++ b/bundle.json @@ -13,7 +13,7 @@ "name": "thirdparty_jerryscript", "subsystem": "", "syscap": [], - "features": [], + "features": ["thirdparty_jerryscript_enable_external_context"], "adapted_system_type": [], "rom": "", "ram": "", diff --git a/engine.gni b/engine.gni index 35b3e8b6..ba644a9d 100644 --- a/engine.gni +++ b/engine.gni @@ -11,6 +11,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +declare_args() { + thirdparty_jerryscript_enable_external_context = true +} + engine_path = "//third_party/jerryscript" core_path = "${engine_path}/jerry-core" diff --git a/jerry-core/BUILD.gn b/jerry-core/BUILD.gn index 1cec29eb..454ff955 100644 --- a/jerry-core/BUILD.gn +++ b/jerry-core/BUILD.gn @@ -239,7 +239,6 @@ if (board_toolchain_type != "iccarm") { "JERRY_GC_LIMIT=(0)", "JERRY_CPOINTER_32_BIT=0", "JERRY_ERROR_MESSAGES=1", - "JERRY_EXTERNAL_CONTEXT=1", "JERRY_PARSER=1", "JERRY_LINE_INFO=1", "JERRY_LOGGING=0", @@ -260,6 +259,9 @@ if (board_toolchain_type != "iccarm") { "SNAPSHOT_BUFFER_SIZE=48*1024", "_BSD_SOURCE", ] + if (thirdparty_jerryscript_enable_external_context == true) { + defines += [ "JERRY_EXTERNAL_CONTEXT=1" ] + } include_dirs = jerry_core_includes include_dirs += [ "$port_path", diff --git a/jerry-ext/BUILD.gn b/jerry-ext/BUILD.gn index 0ee09d90..c9926dcb 100644 --- a/jerry-ext/BUILD.gn +++ b/jerry-ext/BUILD.gn @@ -62,7 +62,6 @@ if (board_toolchain_type == "iccarm") { "JERRY_GC_LIMIT=(0)", "JERRY_CPOINTER_32_BIT=0", "JERRY_ERROR_MESSAGES=1", - "JERRY_EXTERNAL_CONTEXT=1", "JERRY_PARSER=1", "JERRY_LINE_INFO=1", "JERRY_LOGGING=0", @@ -82,6 +81,9 @@ if (board_toolchain_type == "iccarm") { "INPUTJS_BUFFER_SIZE=64*1024", "SNAPSHOT_BUFFER_SIZE=48*1024", ] + if (thirdparty_jerryscript_enable_external_context == true) { + defines += [ "JERRY_EXTERNAL_CONTEXT=1" ] + } include_dirs = jerry_ext_include_dirs include_dirs += [ "${core_path}", diff --git a/jerry-port/default/BUILD.gn b/jerry-port/default/BUILD.gn index dd7c5c9b..d2c46713 100644 --- a/jerry-port/default/BUILD.gn +++ b/jerry-port/default/BUILD.gn @@ -47,7 +47,6 @@ if (board_toolchain_type == "iccarm") { "JERRY_GC_LIMIT=(0)", "JERRY_CPOINTER_32_BIT=0", "JERRY_ERROR_MESSAGES=1", - "JERRY_EXTERNAL_CONTEXT=1", "JERRY_PARSER=1", "JERRY_LINE_INFO=1", "JERRY_LOGGING=0", @@ -67,6 +66,9 @@ if (board_toolchain_type == "iccarm") { "INPUTJS_BUFFER_SIZE=64*1024", "SNAPSHOT_BUFFER_SIZE=48*1024", ] + if (thirdparty_jerryscript_enable_external_context == true) { + defines += [ "JERRY_EXTERNAL_CONTEXT=1" ] + } include_dirs = jerry_port_default_include_dirs include_dirs += [ "${core_path}", -- Gitee