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}", ".")
18config("updater_ui_support_cfg") {
19  if (updater_ui_support) {
20    defines = [ "UPDATER_UI_SUPPORT" ]
21  }
22  include_dirs = [
23    "${updater_path}/interfaces/kits/include",
24    "${updater_path}/services/ui",
25    "${updater_path}/services/ui/include",
26    "${updater_path}/services/ui/control",
27    "${updater_path}/services/ui/driver",
28    "${updater_path}/services/ui/view",
29    "${updater_path}/services/ui/language",
30  ]
31}
32
33ohos_static_library("libui") {
34  defines = [
35    "ENABLE_BITMAP_FONT = 0",
36    "ENABLE_ICU = 1",
37    "ENABLE_MULTI_FONT = 0",
38    "ENABLE_SHAPING = 0",
39    "ENABLE_STATIC_FONT = 0",
40    "ENABLE_VECTOR_FONT = 1",
41  ]
42
43  public_configs = [ ":updater_ui_support_cfg" ]
44
45  sources = [
46    "control/callback_manager.cpp",
47    "control/event_listener.cpp",
48    "control/event_manager.cpp",
49    "driver/drm_driver.cpp",
50    "driver/fbdev_driver.cpp",
51    "driver/graphic_engine.cpp",
52    "driver/input_event.cpp",
53    "driver/keys_input_device.cpp",
54    "driver/pointers_input_device.cpp",
55    "driver/surface_dev.cpp",
56    "driver/ui_rotation.cpp",
57    "language/language_ui.cpp",
58    "strategy/logo_strategy.cpp",
59    "strategy/progress_strategy.cpp",
60    "strategy/ui_strategy.cpp",
61    "updater_ui_config.cpp",
62    "updater_ui_env.cpp",
63    "updater_ui_facade.cpp",
64    "updater_ui_tools.cpp",
65    "view/component/box_progress_adapter.cpp",
66    "view/component/component_factory.cpp",
67    "view/component/img_view_adapter.cpp",
68    "view/component/label_btn_adapter.cpp",
69    "view/component/text_label_adapter.cpp",
70    "view/layout/auto_layout.cpp",
71    "view/layout/layout_parser.cpp",
72    "view/page/base_page.cpp",
73    "view/page/page.cpp",
74    "view/page/page_manager.cpp",
75    "view/page/sub_page.cpp",
76    "view/view_api.cpp",
77  ]
78
79  include_dirs = [
80    "${updater_path}/services/common",
81    "${updater_path}/services/include/log",
82    "${updater_path}/services/include",
83    "${updater_path}/utils/include",
84    "${updater_path}/utils/json",
85    "${updater_path}/services",
86    "${updater_path}/interfaces/kits/include",
87    "${updater_path}/services/ui",
88    "${updater_path}/services/ui/include",
89    "${updater_path}/services/ui/control",
90    "${updater_path}/services/ui/driver",
91    "${updater_path}/services/ui/view",
92    "${updater_path}/services/ui/language",
93  ]
94
95  deps = [
96    "${updater_path}/interfaces/kits/packages:libpackageExt",
97    "${updater_path}/services/log:libupdaterlog",
98    "${updater_path}/utils:libutils",
99  ]
100
101  external_deps = [
102    "bounds_checking_function:libsec_static",
103    "cJSON:cjson",
104    "libdrm:libdrm",
105    "libpng:libpng",
106  ]
107
108  if (!updater_ui_support) {
109    sources = []
110  } else {
111    external_deps += [
112      "drivers_peripheral_input:hdi_input",
113      "ui_lite:libupdater_layout",
114    ]
115  }
116
117  if (defined(updater_ui_custom_cfg)) {
118    public_configs += updater_ui_custom_cfg
119  }
120
121  subsystem_name = "updater"
122  part_name = "updater"
123}
124