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/updater/updater_default_cfg.gni") 15import("//build/ohos.gni") 16 17config("updater_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "//base/update/updater/interfaces/kits/include", 21 "//base/update/updater/services", 22 "//base/update/updater/services/include/package", 23 "//base/update/updater/services/include/script", 24 "//base/update/updater/services/include/log", 25 "//base/update/updater/services/include", 26 "//base/update/updater/utils/include", 27 "//base/update/updater/utils/json", 28 "//base/update/updater/services/include/applypatch", 29 "//base/startup/init/interfaces/innerkits/include", 30 "//third_party/openssl/include", 31 "//third_party/bounds_checking_function/include", 32 "//drivers/hdf/frameworks/include/utils", 33 ] 34} 35 36ohos_executable("updater_binary") { 37 sources = [ 38 "//base/update/updater/services/updater_binary/main.cpp", 39 "//base/update/updater/services/updater_binary/update_image_block.cpp", 40 "//base/update/updater/services/updater_binary/update_image_patch.cpp", 41 "//base/update/updater/services/updater_binary/update_partitions.cpp", 42 "//base/update/updater/services/updater_binary/update_processor.cpp", 43 ] 44 configs = [ ":updater_config" ] 45 46 ldflags = [ "-Wl -std=c++11" ] 47 if (defined(binary_force_link_libs)) { 48 ldflags += [ "-Wl,--whole-archive" ] 49 foreach(lib, binary_force_link_libs) { 50 ldflags += [ "${lib}" ] 51 } 52 ldflags += [ "-Wl,--no-whole-archive" ] 53 } 54 deps = [ 55 "//base/update/updater/interfaces/kits/misc_info:libmiscinfo", 56 "//base/update/updater/interfaces/kits/slot_info:libslotinfo", 57 "//base/update/updater/services/applypatch:libapplypatch", 58 "//base/update/updater/services/diffpatch/patch:libpatch", 59 "//base/update/updater/services/fs_manager:libfsmanager", 60 "//base/update/updater/services/log:libupdaterlog", 61 "//base/update/updater/services/package:libupdaterpackage", 62 "//base/update/updater/services/script:libupdaterscript", 63 "//third_party/bzip2:libbz2", 64 "//third_party/cJSON:cjson_static", 65 "//third_party/lz4:liblz4_static", 66 "//third_party/openssl:libcrypto_static", 67 "//third_party/openssl:ssl_source", 68 "//third_party/zlib:libz", 69 ] 70 71 if (defined(binary_custom_lib)) { 72 deps += binary_custom_lib 73 } 74 75 if (defined(use_ptable)) { 76 include_dirs = [ "//base/update/updater/services/ptable_parse" ] 77 deps += [ "//base/update/updater/services/ptable_parse:libptableparse" ] 78 defines = [ "UPDATER_USE_PTABLE" ] 79 } 80 81 external_deps += [ "init:libfsmanager_static" ] 82 83 install_enable = true 84 install_images = [ 85 "system", 86 "updater", 87 ] 88 part_name = "updater" 89 subsystem_name = "updater" 90} 91