• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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/ets_frontend/es2panda/es2abc_config.gni")
15import("//arkcompiler/ets_frontend/ets_frontend_config.gni")
16import("//arkcompiler/runtime_core/ark_config.gni")
17
18es2panda_src = [
19  "es2panda.cpp",
20  "binder/binder.cpp",
21  "binder/declaration.cpp",
22  "binder/scope.cpp",
23  "binder/variable.cpp",
24  "compiler/base/catchTable.cpp",
25  "compiler/base/condition.cpp",
26  "compiler/base/destructuring.cpp",
27  "compiler/base/hoisting.cpp",
28  "compiler/base/iterators.cpp",
29  "compiler/base/lexenv.cpp",
30  "compiler/base/literals.cpp",
31  "compiler/base/lreference.cpp",
32  "compiler/base/optionalChain.cpp",
33  "compiler/core/compileQueue.cpp",
34  "compiler/core/compilerContext.cpp",
35  "compiler/core/compilerImpl.cpp",
36  "compiler/core/dynamicContext.cpp",
37  "compiler/core/emitter/commonjs.cpp",
38  "compiler/core/emitter/emitter.cpp",
39  "compiler/core/emitter/moduleRecordEmitter.cpp",
40  "compiler/core/envScope.cpp",
41  "compiler/core/function.cpp",
42  "compiler/core/inlineCache.cpp",
43  "compiler/core/labelTarget.cpp",
44  "compiler/core/pandagen.cpp",
45  "compiler/core/regAllocator.cpp",
46  "compiler/core/regScope.cpp",
47  "compiler/core/switchBuilder.cpp",
48  "compiler/debugger/debuginfoDumper.cpp",
49  "compiler/function/asyncFunctionBuilder.cpp",
50  "compiler/function/asyncGeneratorFunctionBuilder.cpp",
51  "compiler/function/functionBuilder.cpp",
52  "compiler/function/generatorFunctionBuilder.cpp",
53  "ir/astDump.cpp",
54  "ir/base/annotation.cpp",
55  "ir/base/catchClause.cpp",
56  "ir/base/classDefinition.cpp",
57  "ir/base/classProperty.cpp",
58  "ir/base/classStaticBlock.cpp",
59  "ir/base/decorator.cpp",
60  "ir/base/metaProperty.cpp",
61  "ir/base/methodDefinition.cpp",
62  "ir/base/property.cpp",
63  "ir/base/scriptFunction.cpp",
64  "ir/base/spreadElement.cpp",
65  "ir/base/templateElement.cpp",
66  "ir/expression.cpp",
67  "ir/expressions/arrayExpression.cpp",
68  "ir/expressions/arrowFunctionExpression.cpp",
69  "ir/expressions/assignmentExpression.cpp",
70  "ir/expressions/awaitExpression.cpp",
71  "ir/expressions/binaryExpression.cpp",
72  "ir/expressions/callExpression.cpp",
73  "ir/expressions/chainExpression.cpp",
74  "ir/expressions/classExpression.cpp",
75  "ir/expressions/conditionalExpression.cpp",
76  "ir/expressions/functionExpression.cpp",
77  "ir/expressions/identifier.cpp",
78  "ir/expressions/importExpression.cpp",
79  "ir/expressions/literal.cpp",
80  "ir/expressions/literals/bigIntLiteral.cpp",
81  "ir/expressions/literals/booleanLiteral.cpp",
82  "ir/expressions/literals/nullLiteral.cpp",
83  "ir/expressions/literals/numberLiteral.cpp",
84  "ir/expressions/literals/regExpLiteral.cpp",
85  "ir/expressions/literals/stringLiteral.cpp",
86  "ir/expressions/literals/taggedLiteral.cpp",
87  "ir/expressions/memberExpression.cpp",
88  "ir/expressions/newExpression.cpp",
89  "ir/expressions/objectExpression.cpp",
90  "ir/expressions/omittedExpression.cpp",
91  "ir/expressions/privateIdentifier.cpp",
92  "ir/expressions/sequenceExpression.cpp",
93  "ir/expressions/superExpression.cpp",
94  "ir/expressions/taggedTemplateExpression.cpp",
95  "ir/expressions/templateLiteral.cpp",
96  "ir/expressions/thisExpression.cpp",
97  "ir/expressions/typeArgumentsExpression.cpp",
98  "ir/expressions/unaryExpression.cpp",
99  "ir/expressions/updateExpression.cpp",
100  "ir/expressions/yieldExpression.cpp",
101  "ir/module/assertClause.cpp",
102  "ir/module/assertEntry.cpp",
103  "ir/module/exportAllDeclaration.cpp",
104  "ir/module/exportDefaultDeclaration.cpp",
105  "ir/module/exportNamedDeclaration.cpp",
106  "ir/module/exportSpecifier.cpp",
107  "ir/module/importDeclaration.cpp",
108  "ir/module/importDefaultSpecifier.cpp",
109  "ir/module/importNamespaceSpecifier.cpp",
110  "ir/module/importSpecifier.cpp",
111  "ir/statement.cpp",
112  "ir/statements/blockStatement.cpp",
113  "ir/statements/breakStatement.cpp",
114  "ir/statements/classDeclaration.cpp",
115  "ir/statements/continueStatement.cpp",
116  "ir/statements/debuggerStatement.cpp",
117  "ir/statements/doWhileStatement.cpp",
118  "ir/statements/emptyStatement.cpp",
119  "ir/statements/expressionStatement.cpp",
120  "ir/statements/forInStatement.cpp",
121  "ir/statements/forOfStatement.cpp",
122  "ir/statements/forUpdateStatement.cpp",
123  "ir/statements/functionDeclaration.cpp",
124  "ir/statements/ifStatement.cpp",
125  "ir/statements/labelledStatement.cpp",
126  "ir/statements/loopStatement.cpp",
127  "ir/statements/returnStatement.cpp",
128  "ir/statements/switchCaseStatement.cpp",
129  "ir/statements/switchStatement.cpp",
130  "ir/statements/throwStatement.cpp",
131  "ir/statements/tryStatement.cpp",
132  "ir/statements/variableDeclaration.cpp",
133  "ir/statements/variableDeclarator.cpp",
134  "ir/statements/whileStatement.cpp",
135  "ir/ts/tsAnyKeyword.cpp",
136  "ir/ts/tsArrayType.cpp",
137  "ir/ts/tsAsExpression.cpp",
138  "ir/ts/tsBigintKeyword.cpp",
139  "ir/ts/tsBooleanKeyword.cpp",
140  "ir/ts/tsClassImplements.cpp",
141  "ir/ts/tsConditionalType.cpp",
142  "ir/ts/tsConstructorType.cpp",
143  "ir/ts/tsEnumDeclaration.cpp",
144  "ir/ts/tsEnumMember.cpp",
145  "ir/ts/tsExternalModuleReference.cpp",
146  "ir/ts/tsFunctionType.cpp",
147  "ir/ts/tsImportEqualsDeclaration.cpp",
148  "ir/ts/tsImportType.cpp",
149  "ir/ts/tsIndexSignature.cpp",
150  "ir/ts/tsIndexedAccessType.cpp",
151  "ir/ts/tsInferType.cpp",
152  "ir/ts/tsInterfaceBody.cpp",
153  "ir/ts/tsInterfaceDeclaration.cpp",
154  "ir/ts/tsInterfaceHeritage.cpp",
155  "ir/ts/tsIntersectionType.cpp",
156  "ir/ts/tsLiteralType.cpp",
157  "ir/ts/tsMappedType.cpp",
158  "ir/ts/tsMethodSignature.cpp",
159  "ir/ts/tsModuleBlock.cpp",
160  "ir/ts/tsModuleDeclaration.cpp",
161  "ir/ts/tsNamedTupleMember.cpp",
162  "ir/ts/tsNamespaceExportDeclaration.cpp",
163  "ir/ts/tsNeverKeyword.cpp",
164  "ir/ts/tsNonNullExpression.cpp",
165  "ir/ts/tsNullKeyword.cpp",
166  "ir/ts/tsNumberKeyword.cpp",
167  "ir/ts/tsObjectKeyword.cpp",
168  "ir/ts/tsOptionalType.cpp",
169  "ir/ts/tsParameterProperty.cpp",
170  "ir/ts/tsParenthesizedType.cpp",
171  "ir/ts/tsPrivateIdentifier.cpp",
172  "ir/ts/tsPropertySignature.cpp",
173  "ir/ts/tsQualifiedName.cpp",
174  "ir/ts/tsRestType.cpp",
175  "ir/ts/tsSatisfiesExpression.cpp",
176  "ir/ts/tsSignatureDeclaration.cpp",
177  "ir/ts/tsStringKeyword.cpp",
178  "ir/ts/tsSymbolKeyword.cpp",
179  "ir/ts/tsTemplateLiteralType.cpp",
180  "ir/ts/tsThisType.cpp",
181  "ir/ts/tsTupleType.cpp",
182  "ir/ts/tsTypeAliasDeclaration.cpp",
183  "ir/ts/tsTypeAssertion.cpp",
184  "ir/ts/tsTypeLiteral.cpp",
185  "ir/ts/tsTypeOperator.cpp",
186  "ir/ts/tsTypeParameter.cpp",
187  "ir/ts/tsTypeParameterDeclaration.cpp",
188  "ir/ts/tsTypeParameterInstantiation.cpp",
189  "ir/ts/tsTypePredicate.cpp",
190  "ir/ts/tsTypeQuery.cpp",
191  "ir/ts/tsTypeReference.cpp",
192  "ir/ts/tsUndefinedKeyword.cpp",
193  "ir/ts/tsUnionType.cpp",
194  "ir/ts/tsUnknownKeyword.cpp",
195  "ir/ts/tsVoidKeyword.cpp",
196  "lexer/keywordsUtil.cpp",
197  "lexer/lexer.cpp",
198  "lexer/regexp/regexp.cpp",
199  "lexer/token/sourceLocation.cpp",
200  "lexer/token/token.cpp",
201  "parser/commonjs.cpp",
202  "parser/context/parserContext.cpp",
203  "parser/expressionParser.cpp",
204  "parser/module/sourceTextModuleRecord.cpp",
205  "parser/parserImpl.cpp",
206  "parser/program/program.cpp",
207  "parser/statementParser.cpp",
208  "parser/transformer/transformer.cpp",
209  "typescript/checker.cpp",
210  "typescript/core/binaryLikeExpression.cpp",
211  "typescript/core/destructuringContext.cpp",
212  "typescript/core/function.cpp",
213  "typescript/core/helpers.cpp",
214  "typescript/core/object.cpp",
215  "typescript/core/typeCreation.cpp",
216  "typescript/core/typeElaborationContext.cpp",
217  "typescript/core/typeRelation.cpp",
218  "typescript/core/util.cpp",
219  "typescript/types/anyType.cpp",
220  "typescript/types/arrayType.cpp",
221  "typescript/types/bigintLiteralType.cpp",
222  "typescript/types/bigintType.cpp",
223  "typescript/types/booleanLiteralType.cpp",
224  "typescript/types/booleanType.cpp",
225  "typescript/types/constructorType.cpp",
226  "typescript/types/enumLiteralType.cpp",
227  "typescript/types/enumType.cpp",
228  "typescript/types/functionType.cpp",
229  "typescript/types/globalTypesHolder.cpp",
230  "typescript/types/indexInfo.cpp",
231  "typescript/types/interfaceType.cpp",
232  "typescript/types/neverType.cpp",
233  "typescript/types/nonPrimitiveType.cpp",
234  "typescript/types/nullType.cpp",
235  "typescript/types/numberLiteralType.cpp",
236  "typescript/types/numberType.cpp",
237  "typescript/types/objectDescriptor.cpp",
238  "typescript/types/objectLiteralType.cpp",
239  "typescript/types/objectType.cpp",
240  "typescript/types/signature.cpp",
241  "typescript/types/stringLiteralType.cpp",
242  "typescript/types/stringType.cpp",
243  "typescript/types/symbolType.cpp",
244  "typescript/types/tupleType.cpp",
245  "typescript/types/type.cpp",
246  "typescript/types/typeParameter.cpp",
247  "typescript/types/typeReference.cpp",
248  "typescript/types/typeRelation.cpp",
249  "typescript/types/undefinedType.cpp",
250  "typescript/types/unionType.cpp",
251  "typescript/types/unknownType.cpp",
252  "typescript/types/voidType.cpp",
253  "util/base64.cpp",
254  "util/bitset.cpp",
255  "util/concurrent.cpp",
256  "util/dumper.cpp",
257  "util/helpers.cpp",
258  "util/patchFix.cpp",
259  "util/moduleHelpers.cpp",
260  "util/symbolTable.cpp",
261  "util/ustring.cpp",
262  "util/workerQueue.cpp",
263  "util/commonUtil.cpp",
264]
265
266config("es2abc_config_src") {
267  include_dirs = [
268    "./",
269    "./binder",
270    "./util",
271    "./compiler/base",
272    "./compiler/core",
273    "./compiler/debugger",
274    "./compiler/function",
275    "./ir",
276    "./ir/base",
277    "./ir/expressions",
278    "./ir/module",
279    "./ir/statements",
280    "./ir/ts",
281    "./parser",
282    "./parser/context",
283    "./lexer",
284    "./lexer/token",
285    "./lexer/regexp",
286    "./typescript",
287    "./typescript/types",
288  ]
289
290  cflags = [ "-fexceptions" ]
291}
292
293config("es2abc_config_common") {
294  configs = [
295    "$ark_root:ark_config",
296    "$sdk_libc_secshared_config",
297    "$ark_root/libpandafile:arkfile_public_config",
298    "$ark_root/libpandabase:arkbase_public_config",
299    "$ark_root/assembler:arkassembler_public_config",
300    "$ark_root/abc2program:abc2program_public_config",
301    "$ark_third_party_root/json:nlohmann_json_config",
302    ":es2abc_config_src",
303  ]
304
305  if (enable_bytecode_optimizer) {
306    defines = [ "ENABLE_BYTECODE_OPT" ]
307    configs += [
308      "$ark_root/compiler:arkcompiler_public_config",
309      "$ark_root/bytecode_optimizer:bytecodeopt_public_config",
310    ]
311  }
312}
313
314# generate headers for es2panda parser
315generated_header_dir = "${target_out_dir}/gen"
316action_foreach("gen_keywords_headers") {
317  template_files = [
318    "keywords.h.erb",
319    "keywordsMap.h.erb",
320  ]
321  keywords_templates_dir = "./lexer/templates"
322  keywords_generator = "./lexer/scripts/keywords.rb"
323
324  sources = []
325  foreach(file, template_files) {
326    sources += [ rebase_path("${keywords_templates_dir}/${file}") ]
327  }
328  outputs = [ "${generated_header_dir}/{{source_name_part}}" ]
329
330  script = "scripts/gen_keywords.sh"
331  inputs = [ "${keywords_generator}" ]
332  args = [
333    "-g",
334    rebase_path("${keywords_generator}"),
335    "-t",
336    "{{source}}",
337    "-o",
338    "{{source_name_part}}",
339    "-d",
340    rebase_path("${generated_header_dir}"),
341  ]
342}
343
344# generate headers for es2panda compiler
345isa_gen = "${ark_root}/isa/gen.rb"
346isa_gen_data = "$root_gen_dir/isa/isa.yaml"
347isa_gen_require = "${ark_root}/isa/isapi.rb"
348action_foreach("gen_isa_headers") {
349  deps = [ "//arkcompiler/runtime_core/isa:isa_combine" ]
350
351  template_files = [
352    "isa.h.erb",
353    "formats.h.erb",
354  ]
355  keywords_templates_dir = "./compiler/templates"
356
357  sources = []
358  foreach(file, template_files) {
359    sources += [ rebase_path("${keywords_templates_dir}/${file}") ]
360  }
361  outputs = [ "${generated_header_dir}/{{source_name_part}}" ]
362
363  script = "scripts/gen_isa.sh"
364  inputs = [
365    "${isa_gen}",
366    "${isa_gen_data}",
367    "${isa_gen_require}",
368  ]
369  args = [
370    "-g",
371    rebase_path("${isa_gen}"),
372    "-t",
373    "{{source}}",
374    "-a",
375    rebase_path("${isa_gen_data}"),
376    "-o",
377    "{{source_name_part}}",
378    "-d",
379    rebase_path("${generated_header_dir}"),
380    "-r",
381    rebase_path("${isa_gen_require}"),
382  ]
383}
384
385ohos_static_library("es2panda_lib") {
386  sources = es2panda_src
387  use_exceptions = true
388  if (is_mac && current_cpu == "arm64") {
389    use_rtti = true
390  }
391
392  configs = [
393    ":es2abc_config_common",
394    "../merge_abc:panda_assembly_proto_public_config",
395  ]
396
397  include_dirs = [
398    "${target_out_dir}",
399    "//third_party/icu/icu4c/source/common",
400    "//third_party/icu/icu4c/source/i18n",
401    "//third_party/icu/icu4c/source",
402  ]
403
404  deps = [
405    ":gen_isa_headers",
406    ":gen_keywords_headers",
407    "$ark_third_party_root/icu/icu4c:static_icuuc",
408    "../merge_abc:panda_assembly_proto_static",
409  ]
410
411  external_deps = []
412  if (!is_arkui_x) {
413    external_deps += [
414      "json:nlohmann_json_static",
415      "runtime_core:abc2program_frontend_static",
416      "runtime_core:libarkassembler_frontend_static",
417      "runtime_core:libarkbase_frontend_static",
418      "runtime_core:libarkfile_frontend_static",
419      "runtime_core:libarkziparchive_frontend_static",
420    ]
421
422    if (enable_bytecode_optimizer) {
423      external_deps += [
424        "runtime_core:libarkbytecodeopt_frontend_static",
425        "runtime_core:libarkcompiler_frontend_static",
426      ]
427    }
428  } else {
429    deps += [
430      "$ark_root/abc2program:abc2program_frontend_static",
431      "$ark_root/assembler:libarkassembler_frontend_static",
432      "$ark_root/libpandabase:libarkbase_frontend_static",
433      "$ark_root/libpandafile:libarkfile_frontend_static",
434      "$ark_root/libziparchive:libarkziparchive_frontend_static",
435      "$ark_third_party_root/json:nlohmann_json_static",
436    ]
437    if (enable_bytecode_optimizer) {
438      deps += [
439        "$ark_root/bytecode_optimizer:libarkbytecodeopt_frontend_static",
440        "$ark_root/compiler:libarkcompiler_frontend_static",
441      ]
442    }
443  }
444  if (ark_standalone_build) {
445    external_deps += [
446      "protobuf:protobuf_lite_static",
447      "protobuf:protobuf_static",
448    ]
449  }
450  cflags = [
451    "-Wno-c++20-designator",
452    "-Wno-implicit-fallthrough",
453  ]
454
455  part_name = "ets_frontend"
456  subsystem_name = "arkcompiler"
457}
458
459ohos_executable("es2panda") {
460  use_exceptions = true
461  if (is_mac && current_cpu == "arm64") {
462    use_rtti = true
463  }
464
465  sources = [
466    "aot/emitFiles.cpp",
467    "aot/main.cpp",
468    "aot/options.cpp",
469    "aot/resolveDepsRelation.cpp",
470  ]
471
472  include_dirs = [ "./aot" ]
473
474  configs = [
475    ":es2abc_config_common",
476    "//arkcompiler/ets_frontend/merge_abc:panda_assembly_proto_public_config",
477  ]
478
479  deps = [
480    ":es2panda_lib",
481    "//arkcompiler/ets_frontend/merge_abc:panda_assembly_proto_static",
482  ]
483
484  external_deps = [ "zlib:libz" ]
485  if (ark_standalone_build) {
486    external_deps += [
487      "protobuf:protobuf_lite_static",
488      "protobuf:protobuf_static",
489    ]
490  }
491
492  ldflags = []
493  if (is_linux) {
494    if (build_public_version) {
495      ldflags += [ "-Wl,-Bstatic" ]
496      ldflags += [ "-lstdc++" ]
497      ldflags += [ "-Wl,-Bdynamic" ]
498    } else {
499      libs = [ libcpp_static_lib ]
500    }
501  }
502
503  # The default stack size of the Windows platform is 1024 kb, which might lead to stack overflow.
504  # Here is to set the stack size of es2abc.exe to 10M, which is the default value for Linux platform.
505  if (is_mingw) {
506    ldflags += [ "-Wl,--stack,10485760" ]
507  }
508
509  output_name = "es2abc"
510  install_enable = false
511  part_name = "ets_frontend"
512  subsystem_name = "arkcompiler"
513}
514
515if (is_linux || (is_build_sdk && is_ohos)) {
516  ohos_copy("es2abc_build") {
517    deps = [ ":es2panda" ]
518    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
519    outputs = [ "${target_out_dir}/es2abc-tmp" ]
520    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
521    module_install_name = "es2abc"
522  }
523
524  ohos_copy("es2abc_build_ets") {
525    deps = [ ":es2panda" ]
526    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
527    outputs = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc-ets" ]
528    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
529    module_install_name = "es2abc"
530  }
531}
532
533if (is_mingw) {
534  ohos_copy("es2abc_build_win") {
535    deps = [ ":es2panda" ]
536    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc.exe" ]
537    outputs = [ "${target_out_dir}/es2abc-tmp" ]
538    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
539    module_install_name = "es2abc.exe"
540  }
541
542  ohos_copy("es2abc_build_win_ets") {
543    deps = [ ":es2panda" ]
544    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc.exe" ]
545    outputs = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc-win-ets" ]
546    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
547    module_install_name = "es2abc.exe"
548  }
549}
550
551if (is_mac) {
552  ohos_copy("es2abc_build_mac") {
553    deps = [ ":es2panda" ]
554    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
555    outputs = [ "${target_out_dir}/es2abc-tmp" ]
556    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
557    module_install_name = "es2abc"
558  }
559
560  ohos_copy("es2abc_build_mac_ets") {
561    deps = [ ":es2panda" ]
562    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
563    outputs = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc-mac-ets" ]
564    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
565    module_install_name = "es2abc"
566  }
567}
568
569if (is_linux) {
570  ohos_copy("build_es2abc_for_hap") {
571    deps = [ ":es2panda(${host_toolchain})" ]
572    es2abc_root_out_dir =
573        get_label_info(":es2panda_build($host_toolchain)", "root_out_dir")
574    es2abc_target_out_dir =
575        get_label_info(":es2panda_build($host_toolchain)", "target_out_dir")
576
577    sources = [ "${es2abc_root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
578    outputs = [ "${es2abc_target_out_dir}/build/bin/es2abc" ]
579  }
580} else if (is_mac) {
581  ohos_copy("build_es2abc_for_hap") {
582    deps = [ ":es2panda(${host_toolchain})" ]
583    es2abc_root_out_dir =
584        get_label_info(":es2panda_build($host_toolchain)", "root_out_dir")
585    es2abc_target_out_dir =
586        get_label_info(":es2panda_build($host_toolchain)", "target_out_dir")
587
588    sources = [ "${es2abc_root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
589    outputs = [ "${es2abc_target_out_dir}/build-mac/bin/es2abc" ]
590  }
591}
592
593ohos_copy("panda_es2abc") {
594  sources = [ "${es2abc_root}/scripts/ts2abc.js" ]
595
596  outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
597  module_source_dir = target_out_dir + "/$target_name/"
598  module_install_name = ""
599
600  part_name = "ets_frontend"
601  subsystem_name = "arkcompiler"
602}
603
604ohos_copy("panda_es2abc_ets") {
605  sources = [ "${es2abc_root}/scripts/ts2abc.js" ]
606  outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
607  module_source_dir = target_out_dir + "/$target_name/"
608  module_install_name = ""
609
610  part_name = "ets_frontend"
611  subsystem_name = "arkcompiler"
612}
613
614ohos_copy("es2abc_js_file") {
615  sources = [ "${es2abc_root}/scripts/ts2abc.js" ]
616  outputs = [ target_out_dir + "/{{source_file_part}}" ]
617
618  part_name = "ets_frontend"
619  subsystem_name = "arkcompiler"
620}
621
622group("es2panda_build") {
623  if (host_os == "linux") {
624    deps = [ ":es2panda(${toolchain_linux})" ]
625  }
626
627  if (host_os == "mac") {
628    deps = [ ":es2panda(${toolchain_mac})" ]
629  }
630
631  if (host_os == "ohos") {
632    deps = [ ":es2panda(${toolchain_ohos})" ]
633  }
634}
635
636group("es2panda_build_win") {
637  deps = [ ":es2panda(${toolchain_win})" ]
638}
639
640group("es2abc_tests") {
641}
642