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("diff_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/diff", 34 "${updater_path}/services/diffpatch", 35 "//third_party/bounds_checking_function/include", 36 "//third_party/bzip2", 37 ] 38 defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] 39} 40 41ohos_static_library("libdiff") { 42 sources = [ 43 "${updater_path}/services/diffpatch/bzip2/bzip2_adapter.cpp", 44 "${updater_path}/services/diffpatch/diff/blocks_diff.cpp", 45 "${updater_path}/services/diffpatch/diff/image_diff.cpp", 46 "${updater_path}/services/diffpatch/diff/update_diff.cpp", 47 "${updater_path}/services/diffpatch/diffpatch.cpp", 48 ] 49 50 deps = [ 51 "//third_party/bounds_checking_function:libsec_static", 52 "//third_party/bzip2:libbz2", 53 "//third_party/openssl:libcrypto_shared", 54 ] 55 configs = [ ":diff_config" ] 56 57 subsystem_name = "updater" 58 part_name = "updater" 59} 60