1# Copyright (c) 2022 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/toolchain/toolchain.gni")
15import("$build_root/config/components/ets_frontend/ets_frontend_config.gni")
16
17print("root_out_dir=$root_out_dir")
18print("root_build_dir=$root_build_dir")
19print("root_gen_dir=$root_gen_dir")
20print("default_toolchain=$default_toolchain")
21print("current_toolchain=$current_toolchain")
22print("host_toolchain=$host_toolchain")
23print("current_os=$current_os,   current_cpu=$current_cpu")
24print("host_os=$host_os,      host_cpu=$host_cpu")
25print("target_os=$target_os,    target_cpu=$target_cpu")
26
27print()
28
29group("default") {
30  deps = [
31    ":ets_frontend",
32    ":ets_runtime",
33    ":runtime_core",
34    ":toolchain",
35  ]
36}
37
38group("unittest_packages") {
39  testonly = true
40  deps = [ "$toolchain_root:ark_js_host_unittest" ]
41}
42
43group("ets_runtime") {
44  deps = [
45    "$js_root:libark_jsruntime",
46    "$js_root/ecmascript/js_vm:ark_js_vm",
47    "$js_root/ecmascript/quick_fix:quick_fix",
48  ]
49  if ((target_os == "linux" && target_cpu == "x64") ||
50      (target_cpu == "arm64" && target_os == "ohos") ||
51      (target_cpu == "arm64" && target_os == "mac")) {
52    deps += [
53      "$js_root/ecmascript/compiler:ark_aot_compiler",
54      "$js_root/ecmascript/compiler:ark_stub_compiler",
55      "$js_root/ecmascript/compiler:libark_jsoptimizer",
56      "$js_root/ecmascript/compiler:stub.an",
57      "$js_root/ecmascript/pgo_profiler/prof_dump:profdump",
58    ]
59  }
60}
61
62group("ets_frontend") {
63  if ((target_os == "linux" && target_cpu == "x64") || target_os == "mingw" ||
64      target_os == "mac") {
65    deps = [
66      "$ets_frontend_root/es2panda:es2panda",
67      "$ets_frontend_root/merge_abc:merge_abc",
68    ]
69  }
70}
71
72group("runtime_core") {
73  deps = [
74    "$ark_root:ark_host_defectscanaux_tools",
75    "$ark_root/disassembler:ark_disasm",
76  ]
77}
78
79group("static_core") {
80  deps = [
81    "$ark_root/static_core/assembler:libarktsassembler",
82    "$ark_root/static_core/bytecode_optimizer:libarktsbytecodeopt",
83    "$ark_root/static_core/libpandabase:libarktsbase",
84    "$ark_root/static_core/libpandafile:libarktsfile",
85  ]
86}
87
88group("toolchain") {
89  deps = []
90  if (target_cpu != "mipsel") {
91    deps += [
92      "$toolchain_root/inspector:ark_debugger",
93      "$toolchain_root/inspector:connectserver_debugger",
94      "$toolchain_root/tooling:libark_ecma_debugger",
95    ]
96  }
97  if (target_os != "mingw") {
98    deps += [
99      "$toolchain_root/tooling/client:libark_client",
100      "$toolchain_root/tooling/client/ark_cli:arkdb",
101      "$toolchain_root/tooling/client/ark_multi:ark_multi",
102    ]
103  }
104}
105