1# Copyright (c) 2021-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}", ".")
18
19config("libsysinstallerkits_exported_headers") {
20  visibility = [ ":*" ]
21  include_dirs = [
22    "${sys_installer_path}/common/include",
23    "${sys_installer_path}/include",
24    "${sys_installer_path}/interfaces/innerkits",
25    "${sys_installer_path}/interfaces/inner_api/include",
26    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
27  ]
28}
29
30ohos_shared_library("libsysinstaller_shared") {
31  defines = [ "SYS_INSTALLER_KITS" ]
32  sources = [
33    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_callback.cpp",
34    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_kits_impl.cpp",
35    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_load_callback.cpp",
36    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_proxy.cpp",
37  ]
38
39  include_dirs = [
40    "${sys_installer_path}/common/include",
41    "${sys_installer_path}/include",
42    "${sys_installer_path}/interfaces/innerkits",
43    "${sys_installer_path}/interfaces/inner_api/include",
44    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
45  ]
46
47  public_configs = [ ":libsysinstallerkits_exported_headers" ]
48
49  deps = []
50
51  external_deps = [
52    "bounds_checking_function:libsec_shared",
53    "c_utils:utils",
54    "hilog:libhilog",
55    "init:libbegetutil",
56    "ipc:ipc_core",
57    "lz4:liblz4_static",
58    "safwk:system_ability_fwk",
59    "samgr:samgr_proxy",
60    "updater:libupdaterlog",
61    "updater:libutils_fs",
62    "zlib:shared_libz",
63  ]
64
65  innerapi_tags = [
66    "platformsdk",
67    "sasdk",
68  ]
69
70  part_name = "sys_installer"
71  subsystem_name = "updater"
72}
73
74ohos_static_library("libsysinstallerkits") {
75  defines = [ "SYS_INSTALLER_KITS" ]
76  sources = [
77    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_callback.cpp",
78    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_kits_impl.cpp",
79    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_load_callback.cpp",
80    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_proxy.cpp",
81  ]
82
83  include_dirs = [
84    "${sys_installer_path}/common/include",
85    "${sys_installer_path}/include",
86    "${sys_installer_path}/interfaces/innerkits",
87    "${sys_installer_path}/interfaces/inner_api/include",
88    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
89  ]
90
91  public_configs = [ ":libsysinstallerkits_exported_headers" ]
92
93  deps = []
94
95  external_deps = [
96    "bounds_checking_function:libsec_static",
97    "c_utils:utils",
98    "hilog:libhilog",
99    "init:libbegetutil",
100    "ipc:ipc_core",
101    "safwk:system_ability_fwk",
102    "samgr:samgr_proxy",
103    "updater:libupdaterlog",
104    "updater:libutils",
105  ]
106
107  part_name = "sys_installer"
108  subsystem_name = "updater"
109}
110
111ohos_executable("sys_installer_client") {
112  sources = [ "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_client.cpp" ]
113
114  include_dirs = [
115    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
116    "${sys_installer_path}/interfaces/inner_api/include",
117  ]
118
119  deps = [
120    "${sys_installer_path}/interfaces/innerkits/ipc_client:libsysinstallerkits",
121  ]
122  external_deps = [
123    "bounds_checking_function:libsec_static",
124    "c_utils:utils",
125    "hilog:libhilog",
126    "init:libbegetutil",
127    "ipc:ipc_core",
128    "safwk:system_ability_fwk",
129    "samgr:samgr_proxy",
130  ]
131  install_enable = true
132  part_name = "sys_installer"
133  subsystem_name = "updater"
134}
135
136module_update_gen("module_update") {
137  include_dirs = [ "./include" ]
138
139  deps = [ "${sys_installer_path}/interfaces/innerkits/ipc_client:libmodule_update_shared" ]
140
141  public_configs = [ ":exported_header_files" ]
142
143  if (defined(module_update_custom_external_deps)) {
144    external_deps = module_update_custom_external_deps
145  }
146
147  part_name = "sys_installer"
148  subsystem_name = "updater"
149}
150
151config("exported_header_files") {
152  visibility = [ ":*" ]
153  include_dirs = [
154    "${sys_installer_path}/services/module_update/util/include",
155    "${sys_installer_path}/interfaces/inner_api/include",
156    "${sys_installer_path}/interfaces/innerkits/ipc_client/include",
157  ]
158}
159
160ohos_executable("module_update_client") {
161  sources =
162      [ "${sys_installer_path}/interfaces/innerkits/ipc_client/src/main.cpp" ]
163
164  include_dirs = [ "./include" ]
165  deps = [ "${sys_installer_path}/interfaces/innerkits/ipc_client:libmodule_update_shared" ]
166  public_configs = [ ":exported_header_files" ]
167
168  external_deps = [
169    "c_utils:utils",
170    "ipc:ipc_core",
171    "samgr:samgr_proxy",
172    "updater:libupdaterlog",
173  ]
174  install_enable = false
175  part_name = "sys_installer"
176  subsystem_name = "updater"
177}
178
179ohos_static_library("module_update_client_static") {
180  sources = [
181    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_kits_impl.cpp",
182    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_load_callback.cpp",
183    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_proxy.cpp",
184    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_callback.cpp",
185    "${sys_installer_path}/services/module_update/util/src/module_ipc_helper.cpp",
186  ]
187
188  include_dirs = [ "${sys_installer_path}/common/include" ]
189
190  public_configs = [ ":exported_header_files" ]
191
192  public_external_deps = [ "zlib:shared_libz" ]
193
194  external_deps = [
195    "bounds_checking_function:libsec_static",
196    "c_utils:utils",
197    "init:libbegetutil",
198    "ipc:ipc_core",
199    "samgr:samgr_proxy",
200    "updater:libupdaterlog",
201    "zlib:shared_libz",
202  ]
203
204  part_name = "sys_installer"
205  subsystem_name = "updater"
206}
207
208ohos_shared_library("libmodule_update_shared") {
209  sources = [
210    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_kits_impl.cpp",
211    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_load_callback.cpp",
212    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_proxy.cpp",
213    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_callback.cpp",
214    "${sys_installer_path}/services/module_update/util/src/module_ipc_helper.cpp",
215  ]
216
217  include_dirs = [ "${sys_installer_path}/common/include" ]
218
219  public_configs = [ ":exported_header_files" ]
220
221  public_external_deps = [ "zlib:shared_libz" ]
222
223  external_deps = [
224    "bounds_checking_function:libsec_static",
225    "c_utils:utils",
226    "init:libbegetutil",
227    "ipc:ipc_core",
228    "samgr:samgr_proxy",
229    "updater:libupdaterlog",
230    "zlib:shared_libz",
231  ]
232
233  innerapi_tags = [
234    "platformsdk",
235    "sasdk",
236  ]
237
238  part_name = "sys_installer"
239  subsystem_name = "updater"
240}
241