From 8ad2cf54d698c5d89435c02a6d038e806a73d3c2 Mon Sep 17 00:00:00 2001 From: Zhenyu Pan Date: Mon, 12 Jun 2023 09:43:06 +0800 Subject: [PATCH] fixed cffa0cc from https://gitee.com/panzhenyu1/ark_ts2abc/pulls/1067 Add deps for ArkUI-X until it resolving resolve external_deps Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I7CJK2 Signed-off-by: Zhenyu Pan Change-Id: I74dcd4f0d9ab4664f1c2f96fc235fbdc7c0a26bc --- es2panda/BUILD.gn | 36 ++++++++++++++++++++++++++---------- ets_frontend_config.gni | 3 +++ merge_abc/BUILD.gn | 25 +++++++++++++++++++------ ts2panda/ts2abc/BUILD.gn | 35 +++++++++++++++++++++++++---------- 4 files changed, 73 insertions(+), 26 deletions(-) diff --git a/es2panda/BUILD.gn b/es2panda/BUILD.gn index b69474ca64..0ef9f8bf34 100644 --- a/es2panda/BUILD.gn +++ b/es2panda/BUILD.gn @@ -401,18 +401,34 @@ ohos_static_library("es2panda_lib") { "../merge_abc:panda_assembly_proto_static", ] - external_deps = [ - "runtime_core:libarkassembler_frontend_static", - "runtime_core:libarkbase_frontend_static", - "runtime_core:libarkfile_frontend_static", - "runtime_core:libarkziparchive_frontend_static", - ] - - if (enable_bytecode_optimizer) { + external_deps = [] + if (!is_cross_platform_build) { external_deps += [ - "runtime_core:libarkbytecodeopt_frontend_static", - "runtime_core:libarkcompiler_frontend_static", + "runtime_core:libarkassembler_frontend_static", + "runtime_core:libarkbase_frontend_static", + "runtime_core:libarkfile_frontend_static", + "runtime_core:libarkziparchive_frontend_static", ] + + if (enable_bytecode_optimizer) { + external_deps += [ + "runtime_core:libarkbytecodeopt_frontend_static", + "runtime_core:libarkcompiler_frontend_static", + ] + } + } else { + deps += [ + "$ark_root/assembler:libarkassembler_frontend_static", + "$ark_root/libpandabase:libarkbase_frontend_static", + "$ark_root/libpandafile:libarkfile_frontend_static", + "$ark_root/libziparchive:libarkziparchive_frontend_static", + ] + if (enable_bytecode_optimizer) { + deps += [ + "$ark_root/bytecode_optimizer:libarkbytecodeopt_frontend_static", + "$ark_root/compiler:libarkcompiler_frontend_static", + ] + } } cflags = [ diff --git a/ets_frontend_config.gni b/ets_frontend_config.gni index 2aa02739e7..499f491e46 100644 --- a/ets_frontend_config.gni +++ b/ets_frontend_config.gni @@ -15,6 +15,9 @@ if (!defined(ark_standalone_build)) { ark_standalone_build = false } +is_cross_platform_build = + defined(build_cross_platform_version) && build_cross_platform_version + if (!ark_standalone_build) { build_root = "//build" ark_third_party_root = "//third_party" diff --git a/merge_abc/BUILD.gn b/merge_abc/BUILD.gn index f70bd94f43..653a782fe2 100644 --- a/merge_abc/BUILD.gn +++ b/merge_abc/BUILD.gn @@ -146,11 +146,20 @@ ohos_source_set("assembly_proto_static") { "$ark_third_party_root/protobuf:protobuf_static", ] - external_deps = [ - "runtime_core:libarkassembler_frontend_static", - "runtime_core:libarkbase_frontend_static", - "runtime_core:libarkfile_frontend_static", - ] + external_deps = [] + if (!is_cross_platform_build) { + external_deps += [ + "runtime_core:libarkassembler_frontend_static", + "runtime_core:libarkbase_frontend_static", + "runtime_core:libarkfile_frontend_static", + ] + } else { + deps += [ + "$ark_root/assembler:libarkassembler_frontend_static", + "$ark_root/libpandabase:libarkbase_frontend_static", + "$ark_root/libpandafile:libarkfile_frontend_static", + ] + } sources = proto_generated_header + proto_generated_source + protobuf_snapshot_generator_sources @@ -192,7 +201,11 @@ ohos_executable("merge_abc") { "$ark_third_party_root/icu/icu4c:static_icuuc", ] - external_deps = [ "runtime_core:libarkziparchive_frontend_static" ] + if (!is_cross_platform_build) { + external_deps = [ "runtime_core:libarkziparchive_frontend_static" ] + } else { + deps += [ "$ark_root/libziparchive:libarkziparchive_frontend_static" ] + } ldflags = [] if (is_linux) { diff --git a/ts2panda/ts2abc/BUILD.gn b/ts2panda/ts2abc/BUILD.gn index 0b017b2db6..5f9c519667 100755 --- a/ts2panda/ts2abc/BUILD.gn +++ b/ts2panda/ts2abc/BUILD.gn @@ -12,6 +12,7 @@ # limitations under the License. import("//arkcompiler/runtime_core/ark_config.gni") +import("../../ets_frontend_config.gni") jsoncpp_root = "$ark_third_party_root/jsoncpp" @@ -92,18 +93,32 @@ ohos_executable("ts2abc") { if (is_linux || is_mingw || is_mac) { deps += [ "$ark_third_party_root/jsoncpp:jsoncpp_static" ] - - external_deps += [ - "runtime_core:libarkassembler_frontend_static", - "runtime_core:libarkbase_frontend_static", - "runtime_core:libarkfile_frontend_static", - "runtime_core:libarkziparchive_frontend_static", - ] - if (enable_bytecode_optimizer) { + if (!is_cross_platform_build) { external_deps += [ - "runtime_core:libarkbytecodeopt_frontend_static", - "runtime_core:libarkcompiler_frontend_static", + "runtime_core:libarkassembler_frontend_static", + "runtime_core:libarkbase_frontend_static", + "runtime_core:libarkfile_frontend_static", + "runtime_core:libarkziparchive_frontend_static", + ] + if (enable_bytecode_optimizer) { + external_deps += [ + "runtime_core:libarkbytecodeopt_frontend_static", + "runtime_core:libarkcompiler_frontend_static", + ] + } + } else { + deps += [ + "$ark_root/assembler:libarkassembler_frontend_static", + "$ark_root/libpandabase:libarkbase_frontend_static", + "$ark_root/libpandafile:libarkfile_frontend_static", + "$ark_root/libziparchive:libarkziparchive_frontend_static", ] + if (enable_bytecode_optimizer) { + deps += [ + "$ark_root/bytecode_optimizer:libarkbytecodeopt_frontend_static", + "$ark_root/compiler:libarkcompiler_frontend_static", + ] + } } } else { deps += [ -- Gitee