diff --git a/build/compile_script/ark.py b/build/compile_script/ark.py index c3fba73276e37a7aafa0ef242488f934205e5ecd..55619152916f0f2bffa55dad9bdd37fcff2a0e1c 100755 --- a/build/compile_script/ark.py +++ b/build/compile_script/ark.py @@ -228,6 +228,11 @@ class ArkPy: "description": "Compile arkcompiler target and run regresstest with arkcompiler target.", "gn_targets_depend_on": ["default"], }, + "hybrid_vms": { + "flags": ["hybrid", "hybrid_vms", "hybridvms"], + "description": "Compile ArkJS and STS VMs in hybrid mode.", + "gn_targets_depend_on": ["hybrid"], + }, "gn_target": { "flags": [""], # any other flags "description": @@ -1015,6 +1020,11 @@ class ArkPy: self.build_for_runtime_core_unittest(out_path, gn_args, self.RUNTIME_CORE_UNITTEST_LOG_FILE_NAME) elif self.is_dict_flags_match_arg(self.ARG_DICT.get("target").get("regresstest"), arg_list[0]): self.build_for_regress_test(out_path, gn_args, arg_list) + elif self.is_dict_flags_match_arg(self.ARG_DICT.get("target").get("hybrid_vms"), arg_list[0]): + self.build_for_gn_target(out_path, + gn_args + ["ark_js_ets_hybrid=true"], + self.ARG_DICT.get("target").get("hybrid_vms").get("gn_targets_depend_on"), + self.GN_TARGET_LOG_FILE_NAME) else: self.build_for_gn_target(out_path, gn_args, arg_list, self.GN_TARGET_LOG_FILE_NAME) return diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn index 8281cdfa44e2361ed14744c02514e8b6c79c7ecf..96b180d5239cec703f42913637758b652c7b7c3e 100644 --- a/build/core/gn/BUILD.gn +++ b/build/core/gn/BUILD.gn @@ -91,6 +91,24 @@ group("static_core") { "$ark_root/static_core/libpandabase:libarktsbase", "$ark_root/static_core/libpandafile:libarktsfile", ] + if (target_os != "mingw") { + deps += [ "$ark_root/static_core/runtime:libarkruntime" ] + } +} + +group("hybrid") { + deps = [ + ":ets_frontend", + ":ets_runtime", + ":static_core", + "$ark_root/static_core/plugins/ets:etsstdlib(${host_toolchain})", + ] + if (target_os != "mingw") { + deps += [ + "$ark_root/static_core/plugins/ets/runtime/interop_js:ets_interop_js_napi", + "$ark_root/static_core/tools/ark_js_napi_cli:ark_js_napi_cli", + ] + } } group("toolchain") { diff --git a/build/third_party_gn/libuv/BUILD.gn b/build/third_party_gn/libuv/BUILD.gn index 5bb82bb0329b9ebb64dce4d017162908d2fb0217..183cd2b41673f45309cb82dbaf1c94b6c476e046 100644 --- a/build/third_party_gn/libuv/BUILD.gn +++ b/build/third_party_gn/libuv/BUILD.gn @@ -66,10 +66,9 @@ config("libuv_config") { "-D_POSIX_C_SOURCE=200112", ] - # Adding NDEBUG macro manually to avoid compilation - # error in debug version, FIX ME - # https://gitee.com/openharmony/build/pulls/1206/files - defines += [ "NDEBUG" ] + if (!is_debug) { + defines += [ "NDEBUG" ] + } } else if (is_mingw || is_win) { cflags += [ "-Wno-missing-braces", @@ -127,13 +126,13 @@ ohos_source_set("libuv_source") { if (is_mac || (defined(is_ios) && is_ios)) { sources += nonwin_srcs + [ "//third_party/libuv/src/unix/bsd-ifaddrs.c", - "//third_party/libuv/src/unix/kqueue.c", - "//third_party/libuv/src/unix/random-getentropy.c", "//third_party/libuv/src/unix/darwin-proctitle.c", "//third_party/libuv/src/unix/darwin.c", "//third_party/libuv/src/unix/fsevents.c", - "//third_party/libuv/src/unix/os390-proctitle.c", + "//third_party/libuv/src/unix/kqueue.c", "//third_party/libuv/src/unix/log_unix.c", + "//third_party/libuv/src/unix/os390-proctitle.c", + "//third_party/libuv/src/unix/random-getentropy.c", "//third_party/libuv/src/unix/trace_unix.c", ] } else if (is_mingw || is_win) { @@ -170,10 +169,10 @@ ohos_source_set("libuv_source") { sources += nonwin_srcs + [ "//third_party/libuv/src/unix/linux.c", "//third_party/libuv/src/unix/procfs-exepath.c", + "//third_party/libuv/src/unix/proctitle.c", "//third_party/libuv/src/unix/random-getentropy.c", "//third_party/libuv/src/unix/random-getrandom.c", "//third_party/libuv/src/unix/random-sysctl-linux.c", - "//third_party/libuv/src/unix/proctitle.c", ] sources += [ "src/log_ohos.c", @@ -182,20 +181,20 @@ ohos_source_set("libuv_source") { } else if (is_linux) { sources += nonwin_srcs + [ "//third_party/libuv/src/unix/linux.c", + "//third_party/libuv/src/unix/log_unix.c", "//third_party/libuv/src/unix/procfs-exepath.c", + "//third_party/libuv/src/unix/proctitle.c", "//third_party/libuv/src/unix/random-getrandom.c", "//third_party/libuv/src/unix/random-sysctl-linux.c", - "//third_party/libuv/src/unix/proctitle.c", - "//third_party/libuv/src/unix/log_unix.c", "//third_party/libuv/src/unix/trace_unix.c", ] } else { sources += nonwin_srcs + [ "//third_party/libuv/src/unix/linux.c", "//third_party/libuv/src/unix/procfs-exepath.c", + "//third_party/libuv/src/unix/proctitle.c", "//third_party/libuv/src/unix/random-getrandom.c", "//third_party/libuv/src/unix/random-sysctl-linux.c", - "//third_party/libuv/src/unix/proctitle.c", ] } subsystem_name = "thirdparty"