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