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}", ".")
18check_module_update_gen("check_module_update") {
19  include_dirs = [ "./include" ]
20
21  deps = [ "${sys_installer_path}/services/module_update/src:check_module_update_staic" ]
22
23  external_deps = [
24    "bounds_checking_function:libsec_shared",
25    "updater:libupdaterlog_shared",
26  ]
27
28  part_name = "sys_installer"
29  subsystem_name = "updater"
30}
31
32ohos_static_library("check_module_update_staic") {
33  sources = [ "${sys_installer_path}/services/module_update/src/main.cpp" ]
34
35  include_dirs = [ "./include" ]
36
37  deps = [
38    "${sys_installer_path}/services/module_update/src:module_update_static",
39  ]
40
41  external_deps = [
42    "bounds_checking_function:libsec_shared",
43    "updater:libupdaterlog_shared",
44  ]
45
46  part_name = "sys_installer"
47  subsystem_name = "updater"
48}
49
50config("module_update_exported_header") {
51  visibility = [ ":*" ]
52  include_dirs = [ "${sys_installer_path}/services/module_update/include" ]
53}
54
55ohos_static_library("module_update_static") {
56  sources = [
57    "${sys_installer_path}/services/module_update/src/module_dm.cpp",
58    "${sys_installer_path}/services/module_update/src/module_file_repository.cpp",
59    "${sys_installer_path}/services/module_update/src/module_loop.cpp",
60    "${sys_installer_path}/services/module_update/src/module_update.cpp",
61    "${sys_installer_path}/services/module_update/src/module_update_task.cpp",
62  ]
63
64  public_configs = [ ":module_update_exported_header" ]
65
66  public_deps =
67      [ "${sys_installer_path}/services/module_update:module_update_utils" ]
68
69  external_deps = [
70    "bounds_checking_function:libsec_shared",
71    "samgr:samgr_common",
72    "updater:libupdaterlog_shared",
73  ]
74
75  if (defined(global_parts_info.startup_hvb)) {
76    defines = [ "SUPPORT_HVB" ]
77
78    external_deps += [
79      "hilog:libhilog",
80      "hvb:libhvb_static",
81      "init:libfsmanager_static_real",
82    ]
83  }
84  part_name = "sys_installer"
85  subsystem_name = "updater"
86}
87