1# Copyright (c) 2021-2025 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14if ((defined(ark_standalone_build) && ark_standalone_build) || 15 (defined(ark_static_standalone_build) && ark_static_standalone_build)) { 16 import("//arkcompiler/runtime_core/static_core/ark_config.gni") 17} else { 18 import( 19 "//build/config/components/runtime_core/static_core/ark_common_config.gni") 20} 21 22if (ark_standalone_build) { 23 import("$build_root/ark.gni") 24} else { 25 import("//build/ohos.gni") 26} 27 28ohos_executable("ets2panda") { 29 sources = [ "main.cpp" ] 30 31 include_dirs = [ 32 "$target_gen_dir", 33 "$target_gen_dir/include", 34 ] 35 if ((defined(ark_standalone_build) && ark_standalone_build) || 36 (defined(ark_static_standalone_build) && ark_static_standalone_build)) { 37 configs = [ "$ark_root:ark_config" ] 38 } else { 39 configs = [ 40 "//build/config/components/runtime_core/static_core:ark_common_config", 41 ] 42 } 43 44 if (ark_standalone_build || ark_static_standalone_build) { 45 configs += [ 46 "$ark_root/assembler:arkassembler_public_config", 47 "$ark_root/libpandafile:arkfile_public_config", 48 "$ark_root/libpandabase:arkbase_public_config", 49 "$ark_root/bytecode_optimizer:bytecodeopt_public_config", 50 "$ark_root/runtime:arkruntime_public_config", 51 "$ark_root/compiler:arkcompiler_public_config", 52 ] 53 } 54 55 configs += [ 56 "$ark_es2panda_root:libes2panda_public_config", 57 ] 58 59 deps = [ 60 "$ark_es2panda_root:libes2panda_frontend_static", 61 "$ark_es2panda_root:libes2panda_public_frontend_static", 62 ] 63 64 if (ark_standalone_build) { 65 deps += [ 66 "$ark_root/bytecode_optimizer:libarktsbytecodeopt_package", 67 "$ark_root/libpandabase:libarktsbase_package", 68 "$ark_root/libpandafile:libarktsfile_package", 69 ] 70 } 71 72 external_deps = [ 73 "runtime_core:libarktsassembler_package", 74 "runtime_core:libarktsbase_package", 75 "runtime_core:libarktsbytecodeopt_package", 76 "runtime_core:libarktscompiler_package", 77 "runtime_core:libarktsfile_package", 78 sdk_libc_secshared_dep, 79 ] 80 81 if (!(ark_standalone_build || ark_static_standalone_build)) { 82 external_deps += [ 83 "runtime_core:assembler_headers", 84 "runtime_core:bytecode_optimizer_headers", 85 "runtime_core:libpandabase_headers", 86 "runtime_core:libpandafile_headers", 87 "runtime_core:runtime_gen_headers", 88 "runtime_core:runtime_headers", 89 "runtime_core:compiler_headers", 90 "runtime_core:verification_headers", 91 ] 92 } 93 94 libs = platform_libs 95 ldflags = platform_ldflags 96 if (is_linux) { 97 libs += [ "stdc++fs" ] 98 } 99 100 output_name = "es2panda" 101 install_enable = true 102 part_name = "ets_frontend" 103 subsystem_name = "arkcompiler" 104} 105