• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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/ets_runtime/js_runtime_config.gni")
15import("//build/ohos.gni")
16import("//build/ohos/sa_profile/sa_profile.gni")
17
18declare_args() {
19  code_sign_enable = true
20
21  if (defined(global_parts_info) &&
22      !defined(global_parts_info.security_code_signature)) {
23    code_sign_enable = false
24  }
25}
26
27config("aot_compiler_service_config") {
28  visibility = [ ":*" ]
29  include_dirs = [
30    "include",
31    "interface",
32  ]
33}
34
35ohos_shared_library("libcompiler_service") {
36  public_configs = [ ":aot_compiler_service_config" ]
37  configs = [ "$js_root:ark_jsruntime_public_config" ]
38  shlib_type = "sa"
39  version_script = "libaot_compiler_service.map"
40  sources = [
41    "${js_root}/ecmascript/log.cpp",
42    "interface/aot_compiler_interface_proxy.cpp",
43    "interface/aot_compiler_interface_stub.cpp",
44    "src/aot_compiler_client.cpp",
45    "src/aot_compiler_error_utils.cpp",
46    "src/aot_compiler_impl.cpp",
47    "src/aot_compiler_load_callback.cpp",
48    "src/aot_compiler_service.cpp",
49    "src/power_disconnected_listener.cpp",
50    "src/screen_status_listener.cpp",
51    "src/thermal_mgr_listener.cpp",
52  ]
53  external_deps = [
54    "ability_base:want",
55    "access_token:libaccesstoken_sdk",
56    "access_token:libtokenid_sdk",
57    "c_utils:utils",
58    "common_event_service:cesfwk_innerkits",
59    "eventhandler:libeventhandler",
60    "hilog:libhilog",
61    "hisysevent:libhisysevent",
62    "hitrace:hitrace_meter",
63    "icu:shared_icui18n",
64    "icu:shared_icuuc",
65    "ipc:ipc_core",
66    "runtime_core:libarkfile_static",
67    "safwk:system_ability_fwk",
68    "samgr:samgr_proxy",
69  ]
70
71  defines = []
72  if (code_sign_enable) {
73    external_deps += [ "code_signature:liblocal_code_sign_sdk" ]
74    defines += [ "CODE_SIGN_ENABLE" ]
75  }
76
77  install_enable = true
78  install_images = [ "system" ]
79
80  part_name = "ets_runtime"
81  subsystem_name = "arkcompiler"
82}
83
84ohos_prebuilt_etc("compiler_service_cfg") {
85  source = "compiler_service.cfg"
86  relative_install_dir = "init"
87  part_name = "ets_runtime"
88  subsystem_name = "arkcompiler"
89}
90
91ohos_sa_profile("compiler_sa_profile") {
92  sources = [ "sa_profile/5300.json" ]
93  part_name = "ets_runtime"
94}
95
96group("compiler_service") {
97  deps = [
98    ":compiler_sa_profile",
99    ":compiler_service_cfg",
100    ":libcompiler_service",
101  ]
102}
103