• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/config/components/idl_tool/idl.gni")
17import("//build/ohos.gni")
18import("../feature/feature.gni")
19
20idl_interface_sources = [ "${target_gen_dir}/update_service_proxy.cpp" ]
21
22idl_include = [
23  "${target_gen_dir}",
24  "${target_gen_dir}/callback",
25]
26
27idl_gen_interface("update_service_interface") {
28  src_idl = rebase_path("IUpdateService.idl")
29  sources_callback = [ "callback/IUpdateCallback.idl" ]
30  dst_file = string_join(",", idl_interface_sources)
31  log_domainid = "0xD002E00"
32  log_tag = "UPDATE_SERVICE_KITS"
33}
34
35ohos_prebuilt_etc("updater_sa.rc") {
36  source = "etc/updater_sa.rc"
37  relative_install_dir = "init"
38  part_name = "$updateengine_part_name"
39  subsystem_name = "updater"
40}
41
42config("updateengine_inner_library_native_config") {
43  include_dirs = [ "$updateengine_root_path/interfaces/inner_api/include" ]
44  include_dirs += feature_include
45  include_dirs += foundations_include
46  include_dirs += idl_include
47}
48
49ohos_shared_library("$updateengine_inner_library_name") {
50  sanitize = {
51    integer_overflow = true
52    ubsan = true
53    boundary_sanitize = true
54    cfi = true
55    cfi_cross_dso = true
56    debug = false
57  }
58  branch_protector_ret = "pac_ret"
59
60  output_values = get_target_outputs(":update_service_interface")
61
62  defines = [ "DUAL_ADAPTER" ]
63  if (!ability_ability_runtime_enable) {
64    defines += [ "ABILITY_RUNTIME_INNER_ENABLE" ]
65  }
66  sources = [
67    "$updateengine_root_path/interfaces/inner_api/engine/src/update_callback.cpp",
68    "$updateengine_root_path/interfaces/inner_api/engine/src/update_service_kits_impl.cpp",
69  ]
70
71  sources += filter_include(output_values, [ "*.cpp" ])
72  include_dirs = [
73    "$updateengine_root_path/interfaces/inner_api/feature/update_model",
74    "$updateengine_root_path/interfaces/inner_api/engine/include",
75    "$updateengine_root_path/interfaces/inner_api/include",
76  ]
77
78  public_configs = [ ":updateengine_inner_library_native_config" ]
79
80  deps = [
81    ":update_service_interface",
82    "$updateengine_root_path/foundations:update_foundations",
83    "$updateengine_root_path/interfaces/inner_api/modulemgr:update_module_mgr",
84  ]
85
86  external_deps = [
87    "bounds_checking_function:libsec_static",
88    "c_utils:utils",  # sptr
89    "cJSON:cjson",
90    "hilog:libhilog",
91    "ipc:ipc_core",
92    "safwk:system_ability_fwk",
93    "samgr:samgr_proxy",
94  ]
95
96  include_dirs += feature_include
97  sources += feature_sources
98  deps += feature_deps
99  external_deps += feature_external_deps
100
101  if (ability_ability_runtime_enable) {
102    external_deps += [ "ability_runtime:extension_manager" ]
103  }
104
105  cflags = [
106    "-fPIC",
107    "-Os",
108    "-Werror",
109    "-fstack-protector-strong",
110  ]
111
112  innerapi_tags = [ "platformsdk" ]
113  part_name = "$updateengine_part_name"
114  subsystem_name = "updater"
115}
116