1# Copyright (c) 2022 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
17updater_path = rebase_path("${updater_absolutely_path}", ".")
18config("updater_config") {
19  visibility = [ ":*" ]
20  include_dirs = [
21    "${updater_path}/services/common",
22    "${updater_path}/services/include",
23    "${updater_path}/services/include",
24    "${updater_path}/utils/include",
25    "${updater_path}/utils/json",
26    "${updater_path}/interfaces/kits/include/",
27    "${updater_path}/services/include/script",
28    "${updater_path}/services/include/package",
29    "${updater_path}/services/include/applypatch",
30    "${updater_path}/services/include/log",
31  ]
32}
33
34config("libptableparse_exported_headers") {
35  visibility = [ ":*" ]
36  include_dirs = [
37    "${updater_path}/services/include",
38    "${updater_path}/services",
39  ]
40}
41
42ohos_static_library("libptableparse") {
43  sources = [
44    "./composite_ptable.cpp",
45    "./emmc_ptable.cpp",
46    "./ptable.cpp",
47    "./ptable_manager.cpp",
48    "./ptable_process.cpp",
49    "./ufs_ptable.cpp",
50  ]
51  configs = [ ":updater_config" ]
52
53  public_configs = [ ":libptableparse_exported_headers" ]
54
55  ldflags = [ "-Wl -std=c++11" ]
56
57  deps = [
58    "${updater_path}/services/log:libupdaterlog",
59    "${updater_path}/utils:libutils",
60  ]
61
62  external_deps = [
63    "bounds_checking_function:libsec_static",
64    "bzip2:libbz2",
65    "cJSON:cjson_static",
66  ]
67
68  part_name = "updater"
69  subsystem_name = "updater"
70}
71