diff --git a/es2panda/BUILD.gn b/es2panda/BUILD.gn index b69474ca644867aae49330b4ff1a08694ae3604c..0ef9f8bf3456378c83010b6da6defaba14acd669 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 2aa02739e73d6fb6aa3b927a73e13f517a50aa40..499f491e4669ac27d8118d365bec5807c0707ff7 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 f70bd94f438db2b0696f00b23ed2246adf982163..653a782fe2b8d34a52bdc76e1da6c71a1d942a1a 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 0b017b2db6e29dcf1a6354de2a1e19575d1e3089..5f9c519667e09d70780b4fdf4831352168d9c6a9 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 += [