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("//build/ohos.gni") 15import("../../updateengine.gni") 16import("../ab_update/ab_update.gni") 17 18ohos_prebuilt_etc("updater_sa.rc") { 19 if (use_musl) { 20 source = "etc/updater_sa.cfg" 21 } else { 22 source = "etc/updater_sa.rc" 23 } 24 relative_install_dir = "init" 25 part_name = "$updateengine_part_name" 26} 27 28ohos_shared_library("$updateengine_library_name") { 29 defines = [ 30 "DUAL_ADAPTER", 31 "UPDATE_SERVICE", 32 ] 33 sources = [ 34 "$updateengine_root_path/services/callback/src/update_callback.cpp", 35 "$updateengine_root_path/services/callback/src/update_callback_proxy.cpp", 36 "$updateengine_root_path/services/callback/src/update_callback_stub.cpp", 37 "$updateengine_root_path/services/engine/src/progress_thread.cpp", 38 "$updateengine_root_path/services/engine/src/update_helper.cpp", 39 "$updateengine_root_path/services/engine/src/update_service.cpp", 40 "$updateengine_root_path/services/engine/src/update_service_stub.cpp", 41 ] 42 43 sources += ab_update_src 44 45 include_dirs = [ 46 "$updateengine_root_path/interfaces/inner_api/include", 47 "$updateengine_root_path/services/callback/include", 48 "$updateengine_root_path/services/engine/include", 49 "//base/update/updater/interfaces/kits/include", 50 "//foundation/systemabilitymgr/safwk/services/safwk/include", 51 "//third_party/bounds_checking_function/include", 52 "//third_party/cJSON", 53 "//third_party/curl/include", 54 "//third_party/openssl/include", 55 "//utils/system/safwk/native/include", 56 ] 57 58 include_dirs += ab_update_include 59 60 deps = [ 61 "//base/update/updater/interfaces/kits/packages:libpackageExt", # "package/package.h" 62 "//base/update/updater/interfaces/kits/updaterkits:libupdaterkits", # "updaterkits/updaterkits.h" 63 "//third_party/bounds_checking_function:libsec_shared", 64 "//third_party/cJSON:cjson", 65 "//third_party/curl:curl_shared", 66 "//third_party/openssl:libcrypto_shared", 67 "//third_party/openssl:libssl_shared", 68 ] 69 70 deps += ab_update_internal_deps 71 72 external_deps = [ 73 "access_token:libaccesstoken_sdk", 74 "c_utils:utils", # sptr 75 "hisysevent_native:libhisysevent", 76 "hiviewdfx_hilog_native:libhilog", 77 "init:libbegetutil", 78 "ipc:ipc_core", 79 "safwk:system_ability_fwk", 80 ] 81 82 part_name = "$updateengine_part_name" 83 84 cflags = [ 85 "-fPIC", 86 "-Os", 87 "-Werror", 88 ] 89} 90