1# Copyright (c) 2021 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/updateservice/foundations/foundations.gni")
15import("//base/update/updateservice/updateengine.gni")
16import("//build/ohos.gni")
17import("../feature/feature.gni")
18
19ohos_prebuilt_etc("updater_sa.rc") {
20  source = "etc/updater_sa.rc"
21  relative_install_dir = "init"
22  part_name = "$updateengine_part_name"
23  subsystem_name = "updater"
24}
25
26config("updateengine_inner_library_native_config") {
27  include_dirs = [ "$updateengine_root_path/interfaces/inner_api/include" ]
28  include_dirs += feature_include
29  include_dirs += foundations_include
30}
31
32ohos_shared_library("$updateengine_inner_library_name") {
33  sanitize = {
34    integer_overflow = true
35    ubsan = true
36    boundary_sanitize = true
37    cfi = true
38    cfi_cross_dso = true
39    debug = false
40  }
41  branch_protector_ret = "pac_ret"
42
43  defines = [ "DUAL_ADAPTER" ]
44  sources = [
45    "$updateengine_root_path/interfaces/inner_api/engine/src/update_callback.cpp",
46    "$updateengine_root_path/interfaces/inner_api/engine/src/update_callback_stub.cpp",
47    "$updateengine_root_path/interfaces/inner_api/engine/src/update_service_kits_impl.cpp",
48    "$updateengine_root_path/interfaces/inner_api/engine/src/update_service_proxy.cpp",
49  ]
50
51  include_dirs = [
52    "$updateengine_root_path/interfaces/inner_api/engine/include",
53    "$updateengine_root_path/interfaces/inner_api/include",
54  ]
55
56  public_configs = [ ":updateengine_inner_library_native_config" ]
57
58  deps = [
59    "$updateengine_root_path/foundations:update_foundations",
60    "$updateengine_root_path/interfaces/inner_api/modulemgr:update_module_mgr",
61  ]
62
63  external_deps = [
64    "ability_runtime:ability_manager",
65    "bounds_checking_function:libsec_static",
66    "c_utils:utils",  # sptr
67    "hilog:libhilog",
68    "ipc:ipc_core",
69    "json:nlohmann_json_static",
70    "safwk:system_ability_fwk",
71    "samgr:samgr_proxy",
72  ]
73
74  include_dirs += feature_include
75  sources += feature_sources
76  deps += feature_deps
77  external_deps += feature_external_deps
78
79  if (ability_ability_runtime_enable) {
80    external_deps += [ "ability_runtime:extension_manager" ]
81  }
82
83  cflags = [
84    "-fPIC",
85    "-Os",
86    "-Werror",
87  ]
88
89  innerapi_tags = [ "platformsdk" ]
90  part_name = "$updateengine_part_name"
91  subsystem_name = "updater"
92}
93