From 95c8691badcfd68575619c453696ad90ed3d2876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=88=E6=84=BF?= Date: Wed, 25 Jun 2025 17:26:18 +0800 Subject: [PATCH] Fixed the alarm for independent compilation Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICGH5D Signed-off-by: chenlong Change-Id: I5566ff6c0d805db56cf24e10e341ba33c1aea273 --- ets2panda/BUILD.gn | 61 +++++++++++++++++++++++++++++++----------- ets2panda/aot/BUILD.gn | 33 +++++++++++++++++------ 2 files changed, 70 insertions(+), 24 deletions(-) diff --git a/ets2panda/BUILD.gn b/ets2panda/BUILD.gn index a7d027eff5..095382867c 100644 --- a/ets2panda/BUILD.gn +++ b/ets2panda/BUILD.gn @@ -23,12 +23,14 @@ config("libes2panda_public_config") { include_dirs = [ "$target_gen_dir", "$target_gen_dir/include", - "$target_gen_dir/generated", "//third_party/icu/icu4c/source/common", "//third_party/icu/icu4c/source/i18n", "//third_party/icu/icu4c/source", "$ark_es2panda_root", ] + if (ark_standalone_build || ark_static_standalone_build) { + include_dirs += [ "$target_gen_dir/generated" ] + } } libes2panda_sources = [ @@ -1095,25 +1097,36 @@ config("libes2panda_config") { ] } -libes2panda_configs = [ - "$ark_root/assembler:arkassembler_public_config", +libes2panda_configs = [] +if (ark_standalone_build || ark_static_standalone_build) { + libes2panda_configs += [ + "$ark_root/assembler:arkassembler_public_config", + "$ark_root/libpandabase:arkbase_public_config", + "$ark_root/libpandafile:arkfile_public_config", + ] +} + +libes2panda_configs += [ "$ark_root:ark_config", ":libes2panda_public_config", ":libes2panda_config", - "$ark_root/libpandabase:arkbase_public_config", - "$ark_root/libpandafile:arkfile_public_config", ] -libes2panda_public_configs = [ - "$ark_root/assembler:arkassembler_public_config", +libes2panda_public_configs = [] +if (ark_standalone_build || ark_static_standalone_build) { + libes2panda_public_configs += [ + "$ark_root/assembler:arkassembler_public_config", + "$ark_root/libpandabase:arkbase_public_config", + "$ark_root/libpandafile:arkfile_public_config", + "$ark_root/bytecode_optimizer:bytecodeopt_public_config", + "$ark_root/runtime:arkruntime_public_config", + "$ark_root/compiler:arkcompiler_public_config", + ] +} +libes2panda_public_configs += [ "$ark_root:ark_config", ":libes2panda_public_config", ":libes2panda_config", - "$ark_root/libpandabase:arkbase_public_config", - "$ark_root/libpandafile:arkfile_public_config", - "$ark_root/bytecode_optimizer:bytecodeopt_public_config", - "$ark_root/compiler:arkcompiler_public_config", - "$ark_root/runtime:arkruntime_public_config", ] ohos_shared_library("libes2panda") { @@ -1159,6 +1172,10 @@ ohos_source_set("libes2panda_frontend_static") { external_deps += [ "icu:static_icui18n", "icu:static_icuuc", + "runtime_core:assembler_headers", + "runtime_core:libpandabase_headers", + "runtime_core:libpandafile_headers", + "runtime_core:runtime_gen_headers", ] } part_name = "ets_frontend" @@ -1198,10 +1215,6 @@ ohos_source_set("libes2panda_public_frontend_static") { deps = [ ":libes2panda_frontend_static" ] - if (ark_standalone_build || ark_static_standalone_build) { - deps += [ "$ark_root/bytecode_optimizer:libarktsbytecodeopt_package" ] - } - if (target_os != "win" && target_os != "mingw" && target_os != "winuwp") { deps += [ ":generate_ets2panda_info" ] defines = [ "ES2PANDA_COMPILE_BY_GN" ] @@ -1211,6 +1224,22 @@ ohos_source_set("libes2panda_public_frontend_static") { "runtime_core:libarktsbytecodeopt_package", sdk_libc_secshared_dep, ] + + if (ark_standalone_build || ark_static_standalone_build) { + deps += [ "$ark_root/bytecode_optimizer:libarktsbytecodeopt_package" ] + } else { + external_deps += [ + "runtime_core:assembler_headers", + "runtime_core:bytecode_optimizer_headers", + "runtime_core:compiler_optimizer_headers", + "runtime_core:libpandabase_headers", + "runtime_core:libpandafile_headers", + "runtime_core:runtime_gen_headers", + "runtime_core:runtime_headers", + "runtime_core:verification_headers", + ] + } + part_name = "ets_frontend" subsystem_name = "arkcompiler" } diff --git a/ets2panda/aot/BUILD.gn b/ets2panda/aot/BUILD.gn index 0a8d75cffd..5b5dd5bbf6 100644 --- a/ets2panda/aot/BUILD.gn +++ b/ets2panda/aot/BUILD.gn @@ -26,16 +26,20 @@ ohos_executable("ets2panda") { "$target_gen_dir", "$target_gen_dir/include", ] - - configs = [ + configs = [] + if (ark_standalone_build || ark_static_standalone_build) { + configs += [ + "$ark_root/assembler:arkassembler_public_config", + "$ark_root/libpandafile:arkfile_public_config", + "$ark_root/libpandabase:arkbase_public_config", + "$ark_root/bytecode_optimizer:bytecodeopt_public_config", + "$ark_root/runtime:arkruntime_public_config", + "$ark_root/compiler:arkcompiler_public_config", + ] + } + configs += [ "$ark_root:ark_config", - "$ark_root/assembler:arkassembler_public_config", "$ark_es2panda_root:libes2panda_public_config", - "$ark_root/libpandafile:arkfile_public_config", - "$ark_root/libpandabase:arkbase_public_config", - "$ark_root/bytecode_optimizer:bytecodeopt_public_config", - "$ark_root/compiler:arkcompiler_public_config", - "$ark_root/runtime:arkruntime_public_config", ] deps = [ @@ -60,6 +64,19 @@ ohos_executable("ets2panda") { sdk_libc_secshared_dep, ] + if (!(ark_standalone_build || ark_static_standalone_build)) { + external_deps += [ + "runtime_core:assembler_headers", + "runtime_core:bytecode_optimizer_headers", + "runtime_core:compiler_optimizer_headers", + "runtime_core:libpandabase_headers", + "runtime_core:libpandafile_headers", + "runtime_core:runtime_gen_headers", + "runtime_core:runtime_headers", + "runtime_core:verification_headers", + ] + } + if (defined(ohos_indep_compiler_enable) && ohos_indep_compiler_enable) { external_deps += [ "icu:shared_icuuc" ] } -- Gitee