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("//base/update/sys_installer/sys_installer_default_cfg.gni")
15import("//build/ohos.gni")
16
17sys_installer_path = rebase_path("${sys_installer_absolutely_path}", ".")
18config("utils_exported_header") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    "${sys_installer_path}/frameworks/installer_manager/include",
23    "${sys_installer_path}/interfaces/innerkits",
24    "${sys_installer_path}/interfaces/inner_api/include",
25    "${sys_installer_path}/services/module_update/util/include",
26  ]
27}
28
29ohos_shared_library("module_update_utils") {
30  sources = [
31    "${sys_installer_path}/services/module_update/util/src/module_file.cpp",
32    "${sys_installer_path}/services/module_update/util/src/module_update_verify.cpp",
33    "${sys_installer_path}/services/module_update/util/src/module_utils.cpp",
34    "${sys_installer_path}/services/module_update/util/src/module_zip_helper.cpp",
35  ]
36
37  public_configs = [ ":utils_exported_header" ]
38
39  public_external_deps = [
40    "cJSON:cjson",
41    "zlib:shared_libz",
42  ]
43
44  deps = []
45
46  external_deps = [
47    "bounds_checking_function:libsec_shared",
48    "cJSON:cjson",
49    "c_utils:utils",
50    "hilog:libhilog",
51    "init:libbegetutil",
52    "ipc:ipc_core",
53    "openssl:libcrypto_shared",
54    "safwk:system_ability_fwk",
55    "samgr:samgr_proxy",
56    "updater:libmiscinfo",
57    "updater:libpackage_shared",
58    "updater:libringbuffer",
59    "updater:libupdaterlog_shared",
60    "updater:libupdaterpackage_shared",
61    "updater:libutils",
62  ]
63
64  if (defined(global_parts_info.startup_hvb)) {
65    sources += [ "${sys_installer_path}/services/module_update/util/src/module_hvb_ops.cpp" ]
66
67    defines = [ "SUPPORT_HVB" ]
68
69    external_deps += [
70      "hvb:libhvb_static",
71      "init:libfsmanager_static_real",
72    ]
73  }
74
75  part_name = "sys_installer"
76  subsystem_name = "updater"
77}
78