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    "${updater_path}/services/package/pkg_manager",
36  ]
37  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
38}
39
40ohos_static_library("libdiff") {
41  sources = [
42    "${updater_path}/services/diffpatch/bzip2/bzip2_adapter.cpp",
43    "${updater_path}/services/diffpatch/diff/blocks_diff.cpp",
44    "${updater_path}/services/diffpatch/diff/image_diff.cpp",
45    "${updater_path}/services/diffpatch/diff/update_diff.cpp",
46    "${updater_path}/services/diffpatch/diffpatch.cpp",
47  ]
48
49  deps = [
50    "${updater_path}/services/log:libupdaterlog",
51    "${updater_path}/services/package:libupdaterpackage",
52  ]
53
54  external_deps = [
55    "bounds_checking_function:libsec_static",
56    "bzip2:libbz2",
57    "openssl:libcrypto_static",
58  ]
59
60  configs = [ ":diff_config" ]
61
62  subsystem_name = "updater"
63  part_name = "updater"
64}
65