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 14if (!is_linux && !is_mingw && !is_mac) { 15 import("//base/update/updater/updater_default_cfg.gni") 16} 17import("//build/ohos.gni") 18SUBSYSTEM_DIR = "//base/update/updater/services/diffpatch" 19 20config("patch_config") { 21 visibility = [ ":*" ] 22 include_dirs = [ 23 "//base/update/updater/interfaces/kits/include/package", 24 "//base/update/updater/interfaces/kits/include", 25 "//base/update/updater/services/include/package", 26 "//base/update/updater/services/include/patch", 27 "//base/update/updater/services/include", 28 "//base/update/updater/utils/include", 29 "//base/update/updater/services/diffpatch/bzip2", 30 "//base/update/updater/services/diffpatch/patch", 31 "//base/update/updater/services/diffpatch", 32 "//third_party/bounds_checking_function/include", 33 "//third_party/bzip2", 34 "//third_party/zlib", 35 "//third_party/lz4/lib", 36 "//third_party/openssl/include", 37 ] 38} 39 40ohos_static_library("libpatch") { 41 sources = [ 42 "$SUBSYSTEM_DIR/bzip2/bzip2_adapter.cpp", 43 "$SUBSYSTEM_DIR/bzip2/lz4_adapter.cpp", 44 "$SUBSYSTEM_DIR/bzip2/zip_adapter.cpp", 45 "$SUBSYSTEM_DIR/diffpatch.cpp", 46 "$SUBSYSTEM_DIR/patch/blocks_patch.cpp", 47 "$SUBSYSTEM_DIR/patch/image_patch.cpp", 48 "$SUBSYSTEM_DIR/patch/update_patch.cpp", 49 ] 50 51 deps = [ 52 "//base/update/updater/services/log:libupdaterlog", 53 "//base/update/updater/services/package:libupdaterpackage", 54 "//third_party/bounds_checking_function:libsec_static", 55 "//third_party/bzip2:libbz2", 56 "//third_party/lz4:liblz4_static", 57 "//third_party/zlib:libz", 58 ] 59 60 configs = [ ":patch_config" ] 61 subsystem_name = "updater" 62 part_name = "updater" 63} 64