1# Copyright (c) 2021-2024 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
14import("//arkcompiler/runtime_core/static_core/ark_config.gni")
15
16if (ark_standalone_build) {
17  import("$build_root/ark.gni")
18} else {
19  import("//build/ohos.gni")
20}
21
22ohos_executable("ets2panda") {
23  sources = [ "main.cpp" ]
24
25  include_dirs = [
26    "$target_gen_dir",
27    "$target_gen_dir/include",
28  ]
29
30  configs = [
31    "$ark_root:ark_config",
32    "$ark_root/assembler:arkassembler_public_config",
33    "$ark_es2panda_root:libes2panda_public_config",
34    "$ark_root/libpandafile:arkfile_public_config",
35    "$ark_root/libpandabase:arkbase_public_config",
36    "$ark_root/bytecode_optimizer:bytecodeopt_public_config",
37    "$ark_root/compiler:arkcompiler_public_config",
38    "$ark_root/runtime:arkruntime_public_config",
39  ]
40
41  deps = [
42    "$ark_es2panda_root:libes2panda_frontend_static",
43    "$ark_es2panda_root:libes2panda_public_frontend_static",
44  ]
45
46  if (ark_standalone_build) {
47    deps += [
48      "$ark_root/bytecode_optimizer:libarktsbytecodeopt_package",
49      "$ark_root/libpandabase:libarktsbase_package",
50      "$ark_root/libpandafile:libarktsfile_package",
51    ]
52  }
53
54  external_deps = [
55    "runtime_core:libarktsassembler_package",
56    "runtime_core:libarktsbase_package",
57    "runtime_core:libarktsbytecodeopt_package",
58    "runtime_core:libarktscompiler_package",
59    "runtime_core:libarktsfile_package",
60    sdk_libc_secshared_dep,
61  ]
62
63  libs = platform_libs
64  ldflags = platform_ldflags
65  if (is_linux) {
66    libs += [ "stdc++fs" ]
67  }
68
69  output_name = "es2panda"
70  install_enable = true
71  part_name = "ets_frontend"
72  subsystem_name = "arkcompiler"
73}
74