13af6ab5fSopenharmony_ci# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
23af6ab5fSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
33af6ab5fSopenharmony_ci# you may not use this file except in compliance with the License.
43af6ab5fSopenharmony_ci# You may obtain a copy of the License at
53af6ab5fSopenharmony_ci#
63af6ab5fSopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0
73af6ab5fSopenharmony_ci#
83af6ab5fSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
93af6ab5fSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
103af6ab5fSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
113af6ab5fSopenharmony_ci# See the License for the specific language governing permissions and
123af6ab5fSopenharmony_ci# limitations under the License.
133af6ab5fSopenharmony_ci
143af6ab5fSopenharmony_ciimport("//arkcompiler/runtime_core/static_core/ark_config.gni")
153af6ab5fSopenharmony_ci
163af6ab5fSopenharmony_ciif (ark_standalone_build) {
173af6ab5fSopenharmony_ci  import("$build_root/ark.gni")
183af6ab5fSopenharmony_ci} else {
193af6ab5fSopenharmony_ci  import("//build/ohos.gni")
203af6ab5fSopenharmony_ci}
213af6ab5fSopenharmony_ci
223af6ab5fSopenharmony_ciohos_executable("ets2panda") {
233af6ab5fSopenharmony_ci  sources = [ "main.cpp" ]
243af6ab5fSopenharmony_ci
253af6ab5fSopenharmony_ci  include_dirs = [
263af6ab5fSopenharmony_ci    "$target_gen_dir",
273af6ab5fSopenharmony_ci    "$target_gen_dir/include",
283af6ab5fSopenharmony_ci  ]
293af6ab5fSopenharmony_ci
303af6ab5fSopenharmony_ci  configs = [
313af6ab5fSopenharmony_ci    "$ark_root:ark_config",
323af6ab5fSopenharmony_ci    "$ark_root/assembler:arkassembler_public_config",
333af6ab5fSopenharmony_ci    "$ark_es2panda_root:libes2panda_public_config",
343af6ab5fSopenharmony_ci    "$ark_root/libpandafile:arkfile_public_config",
353af6ab5fSopenharmony_ci    "$ark_root/libpandabase:arkbase_public_config",
363af6ab5fSopenharmony_ci    "$ark_root/bytecode_optimizer:bytecodeopt_public_config",
373af6ab5fSopenharmony_ci    "$ark_root/compiler:arkcompiler_public_config",
383af6ab5fSopenharmony_ci    "$ark_root/runtime:arkruntime_public_config",
393af6ab5fSopenharmony_ci  ]
403af6ab5fSopenharmony_ci
413af6ab5fSopenharmony_ci  deps = [
423af6ab5fSopenharmony_ci    "$ark_es2panda_root:libes2panda_frontend_static",
433af6ab5fSopenharmony_ci    "$ark_es2panda_root:libes2panda_public_frontend_static",
443af6ab5fSopenharmony_ci  ]
453af6ab5fSopenharmony_ci
463af6ab5fSopenharmony_ci  if (ark_standalone_build) {
473af6ab5fSopenharmony_ci    deps += [
483af6ab5fSopenharmony_ci      "$ark_root/bytecode_optimizer:libarktsbytecodeopt_package",
493af6ab5fSopenharmony_ci      "$ark_root/libpandabase:libarktsbase_package",
503af6ab5fSopenharmony_ci      "$ark_root/libpandafile:libarktsfile_package",
513af6ab5fSopenharmony_ci    ]
523af6ab5fSopenharmony_ci  }
533af6ab5fSopenharmony_ci
543af6ab5fSopenharmony_ci  external_deps = [
553af6ab5fSopenharmony_ci    "runtime_core:libarktsassembler_package",
563af6ab5fSopenharmony_ci    "runtime_core:libarktsbase_package",
573af6ab5fSopenharmony_ci    "runtime_core:libarktsbytecodeopt_package",
583af6ab5fSopenharmony_ci    "runtime_core:libarktscompiler_package",
593af6ab5fSopenharmony_ci    "runtime_core:libarktsfile_package",
603af6ab5fSopenharmony_ci    sdk_libc_secshared_dep,
613af6ab5fSopenharmony_ci  ]
623af6ab5fSopenharmony_ci
633af6ab5fSopenharmony_ci  libs = platform_libs
643af6ab5fSopenharmony_ci  ldflags = platform_ldflags
653af6ab5fSopenharmony_ci  if (is_linux) {
663af6ab5fSopenharmony_ci    libs += [ "stdc++fs" ]
673af6ab5fSopenharmony_ci  }
683af6ab5fSopenharmony_ci
693af6ab5fSopenharmony_ci  output_name = "es2panda"
703af6ab5fSopenharmony_ci  install_enable = true
713af6ab5fSopenharmony_ci  part_name = "ets_frontend"
723af6ab5fSopenharmony_ci  subsystem_name = "arkcompiler"
733af6ab5fSopenharmony_ci}
74