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 if (!ability_ability_runtime_enable) { 45 defines += [ "ABILITY_RUNTIME_INNER_ENABLE" ] 46 } 47 sources = [ 48 "$updateengine_root_path/interfaces/inner_api/engine/src/update_callback.cpp", 49 "$updateengine_root_path/interfaces/inner_api/engine/src/update_callback_stub.cpp", 50 "$updateengine_root_path/interfaces/inner_api/engine/src/update_service_kits_impl.cpp", 51 "$updateengine_root_path/interfaces/inner_api/engine/src/update_service_proxy.cpp", 52 ] 53 54 include_dirs = [ 55 "$updateengine_root_path/interfaces/inner_api/engine/include", 56 "$updateengine_root_path/interfaces/inner_api/include", 57 ] 58 59 public_configs = [ ":updateengine_inner_library_native_config" ] 60 61 deps = [ 62 "$updateengine_root_path/foundations:update_foundations", 63 "$updateengine_root_path/interfaces/inner_api/modulemgr:update_module_mgr", 64 ] 65 66 external_deps = [ 67 "bounds_checking_function:libsec_static", 68 "c_utils:utils", # sptr 69 "hilog:libhilog", 70 "ipc:ipc_core", 71 "json:nlohmann_json_static", 72 "safwk:system_ability_fwk", 73 "samgr:samgr_proxy", 74 ] 75 76 include_dirs += feature_include 77 sources += feature_sources 78 deps += feature_deps 79 external_deps += feature_external_deps 80 81 if (ability_ability_runtime_enable) { 82 external_deps += [ "ability_runtime:extension_manager" ] 83 } 84 85 cflags = [ 86 "-fPIC", 87 "-Os", 88 "-Werror", 89 ] 90 91 innerapi_tags = [ "platformsdk" ] 92 part_name = "$updateengine_part_name" 93 subsystem_name = "updater" 94} 95