• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//ark/js_runtime/js_runtime_config.gni")
15import("//build/ohos.gni")
16
17snapshot_input_path = "//component_dist/aosp-x86_64/packages_to_install/ace_engine_full/ark_build/strip.native.min.abc"
18arkstdlib_abc_path = "//prebuilts/ark_tools/target/aex/arkstdlib.abc"
19snapshot_bin_output_path = "$target_gen_dir/snapshot"
20
21action("gen_snapshot_bin") {
22  visibility = [ ":*" ]
23
24  deps = [ "//ark/js_runtime/ecmascript/js_vm:ark_js_vm(${host_toolchain})" ]
25
26  script = "$ark_root/tools/gen_snapshot.sh"
27
28  args = [
29    "./clang_x64/ark/ark_js_runtime/ark_js_vm ",
30    "--boot-class-spaces=core:ecmascript",
31    "--boot-intrinsic-spaces=core:ecmascript",
32    "--compiler-enable-jit=false",
33    "--gc-type=epsilon",
34    "--runtime-type=ecmascript",
35    "--snapshot-serialize-enabled=true",
36    "--snapshot-file=" + rebase_path(snapshot_bin_output_path),
37    rebase_path(snapshot_input_path),
38    "_GLOBAL::func_main_0",
39  ]
40
41  inputs = [
42    snapshot_input_path,
43    arkstdlib_abc_path,
44  ]
45  outputs = [ snapshot_bin_output_path ]
46}
47
48ohos_prebuilt_etc("gen_ark_snapshot_bin") {
49  deps = [ ":gen_snapshot_bin" ]
50  source = snapshot_bin_output_path
51
52  install_enable = true
53  subsystem_name = "ark"
54}
55