• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
14import("//base/update/updater/updater_default_cfg.gni")
15import("//build/ohos.gni")
16
17updater_path = rebase_path("${updater_absolutely_path}", ".")
18
19config("libutils_exported_headers") {
20  visibility = [ ":*" ]
21  include_dirs = [
22    "${updater_path}/services/include",
23    "${updater_path}/utils/include",
24    "${updater_path}/utils/json",
25  ]
26}
27
28ohos_static_library("libutils") {
29  sources = [
30    "json/json_node.cpp",
31    "partition_utils.cpp",
32    "utils.cpp",
33  ]
34
35  include_dirs = [
36    "include",
37    "${updater_path}/interfaces/kits/include/",
38    "${updater_path}/services/common/",
39    "${updater_path}/services/include/",
40    "//third_party/bounds_checking_function/include",
41    "//third_party/cJSON",
42  ]
43
44  public_configs = [ ":libutils_exported_headers" ]
45
46  deps = [
47    "//third_party/bounds_checking_function:libsec_static",
48    "//third_party/cJSON:cjson",
49  ]
50  external_deps = [ "init:libbegetutil" ]
51
52  if (build_selinux) {
53    external_deps += [ "selinux_adapter:librestorecon" ]
54    deps += [ "//third_party/selinux:libselinux" ]
55    include_dirs += [ "//third_party/selinux/libselinux/include" ]
56    cflags = [ "-DWITH_SELINUX" ]
57  }
58
59  subsystem_name = "updater"
60  part_name = "updater"
61}
62
63ohos_executable("updater_reboot") {
64  sources = [ "updater_reboot.cpp" ]
65
66  include_dirs = [
67    "include",
68    "${updater_path}/interfaces/kits/include/",
69    "${updater_path}/services/include/",
70  ]
71
72  deps = [
73    "${updater_path}/interfaces/kits/misc_info:libmiscinfo",
74    "${updater_path}/services/fs_manager:libfsmanager",
75    "${updater_path}/utils:libutils",
76  ]
77  install_images = [ "updater" ]
78  install_enable = true
79  part_name = "updater"
80  subsystem_name = "updater"
81}
82
83ohos_executable("write_updater") {
84  sources = [ "write_updater.cpp" ]
85
86  include_dirs = [
87    "include",
88    "${updater_path}/interfaces/kits/include/",
89    "${updater_path}/services/include/",
90    "//third_party/bounds_checking_function/include",
91    "//base/startup/init/interfaces/innerkits/include",
92  ]
93
94  deps = [
95    "${updater_path}/interfaces/kits/misc_info:libmiscinfo",
96    "//third_party/bounds_checking_function:libsec_static",
97  ]
98  external_deps = [ "init:libbegetutil" ]
99
100  install_enable = true
101  part_name = "updater"
102  subsystem_name = "updater"
103}
104