• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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("//build/config/clang/clang.gni")
15import("//build/ohos.gni")
16
17ohos_prebuilt_shared_library("libjsvm") {
18  deps = [ ":build_libjsvm" ]
19
20  if (is_asan && use_hwasan) {
21    source = "$target_gen_dir/asan/libjsvm.so"
22  } else {
23    source = "$target_gen_dir/libjsvm.so"
24  }
25  subsystem_name = "arkui"
26  part_name = "napi"
27
28  install_enable = true
29  install_images = [ "system" ]
30  innerapi_tags = [ "ndk" ]
31}
32
33action("build_libjsvm") {
34  external_deps = [
35    "node:node_header_notice",
36    "resource_schedule_service:ressched_client",
37  ]
38  deps = [ "//third_party/musl:musl_all" ]
39  script = "build_jsvm.sh"
40  sources = []
41  if (is_asan && use_hwasan) {
42    outputs = [ "$target_gen_dir/asan/libjsvm.so" ]
43  } else {
44    outputs = [ "$target_gen_dir/libjsvm.so" ]
45  }
46  args = [
47    "--target_gen_dir",
48    rebase_path("$target_gen_dir"),
49    "--target_cpu",
50    "$target_cpu",
51    "--prefix",
52    rebase_path("$clang_base_path/bin"),
53    "--sysroot",
54    rebase_path("$musl_sysroot"),
55    "--node_path",
56    rebase_path("//third_party/node"),
57    "--is_asan",
58    "$is_asan",
59    "--use_hwasan",
60    "$use_hwasan",
61  ]
62  if (use_clang_coverage) {
63    args += [
64      "--target_clang_coverage",
65      "$use_clang_coverage",
66    ]
67  }
68}
69