• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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("//build/ohos.gni")
15import("../windowmanager_aafwk.gni")
16
17config("libwm_private_config") {
18  visibility = [ ":*" ]
19
20  include_dirs = [
21    "include",
22    "../wmserver/include",
23    "../wmserver/include/zidl",
24    "../window_scene/session/host/include",
25    "//foundation/arkui/napi",  # because of ability_context.h
26  ]
27}
28
29config("libwm_public_config") {
30  include_dirs = [
31    "../interfaces/innerkits/wm",
32    "../utils/include",
33    "../window_scene",
34  ]
35}
36
37## Build libwm_static.a
38ohos_static_library("libwm_static") {
39  include_dirs = [
40    "../utils/include",
41    "../window_scene/intention_event/service/anr_manager/include",
42    "../window_scene/intention_event/framework/anr_handler/include",
43    "${window_base_path}/window_scene/intention_event/include",
44  ]
45
46  sources = [
47    "../wmserver/src/zidl/window_manager_proxy.cpp",
48    "src/input_transfer_station.cpp",
49    "src/root_scene.cpp",
50    "src/static_call.cpp",
51    "src/vsync_station.cpp",
52    "src/window.cpp",
53    "src/window_accessibility_controller.cpp",
54    "src/window_adapter.cpp",
55    "src/window_agent.cpp",
56    "src/window_extension_session_impl.cpp",
57    "src/window_frame_trace_impl.cpp",
58    "src/window_impl.cpp",
59    "src/window_input_channel.cpp",
60    "src/window_manager.cpp",
61    "src/window_manager_agent.cpp",
62    "src/window_option.cpp",
63    "src/window_prepare_terminate.cpp",
64    "src/window_scene.cpp",
65    "src/window_scene_session_impl.cpp",
66    "src/window_session_impl.cpp",
67    "src/zidl/window_manager_agent_stub.cpp",
68    "src/zidl/window_stub.cpp",
69  ]
70
71  configs = [
72    ":libwm_private_config",
73    "${window_base_path}/resources/config/build:coverage_flags",
74  ]
75
76  public_configs = [ ":libwm_public_config" ]
77
78  deps = [
79    "${window_base_path}/dm:libdm",
80    "${window_base_path}/utils:libwmutil",
81    "${window_base_path}/window_scene/common:window_scene_common",
82    "${window_base_path}/window_scene/intention_event:libintention_event",
83    "${window_base_path}/window_scene/intention_event/service:intention_event_anr_manager",
84    "${window_base_path}/window_scene/session:scene_session",
85    "${window_base_path}/window_scene/session_manager:session_manager",
86  ]
87
88  external_deps = [
89    "ability_base:want",
90    "ability_runtime:ability_context_native",
91    "ability_runtime:ability_manager",
92    "ability_runtime:app_manager",
93    "ace_engine:ace_uicontent",
94    "c_utils:utils",
95    "eventhandler:libeventhandler",
96    "graphic_2d:librender_service_client",
97    "graphic_2d:window_animation",
98    "hilog:libhilog",
99    "hisysevent:libhisysevent",
100    "hitrace:hitrace_meter",
101    "image_framework:image_native",
102    "init:libbegetutil",
103    "input:libmmi-client",
104    "ipc:ipc_single",
105    "power_manager:powermgr_client",
106    "samgr:samgr_proxy",
107  ]
108
109  defines = []
110  if (efficiency_manager_enable) {
111    external_deps += [ "efficiency_manager:suspend_manager_client" ]
112    defines += [ "EFFICIENCY_MANAGER_ENABLE" ]
113  }
114
115  if (defined(global_parts_info)) {
116    if (defined(
117        global_parts_info.hmosresourceschedule_frame_aware_sched_override)) {
118      defines += [ "FRAME_TRACE_ENABLE" ]
119      external_deps += [ "frame_aware_sched_override:frame_trace_intf" ]
120    } else if (defined(global_parts_info.resourceschedule_frame_aware_sched)) {
121      defines += [ "FRAME_TRACE_ENABLE" ]
122      external_deps += [ "frame_aware_sched:frame_trace_intf" ]
123    }
124  }
125
126  if (defined(global_parts_info) &&
127      defined(global_parts_info.resourceschedule_resource_schedule_service)) {
128    external_deps += [ "resource_schedule_service:ressched_client" ]
129    defines += [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ]
130  }
131
132  if (!defined(global_parts_info) ||
133      defined(global_parts_info.inputmethod_imf)) {
134    imf_enable = true
135  } else {
136    imf_enable = false
137  }
138  print("imf_enable: ", imf_enable)
139
140  if (imf_enable == true) {
141    external_deps += [ "imf:inputmethod_client" ]
142    defines += [ "IMF_ENABLE" ]
143  }
144
145  part_name = "window_manager"
146  subsystem_name = "window"
147}
148
149## Build libwm.so
150ohos_shared_library("libwm") {
151  include_dirs = [
152    "../utils/include",
153    "../window_scene/intention_event/service/anr_manager/include",
154    "../window_scene/intention_event/framework/anr_handler/include",
155    "${window_base_path}/window_scene/intention_event/include",
156  ]
157
158  sources = [
159    "../wmserver/src/zidl/window_manager_proxy.cpp",
160    "src/input_transfer_station.cpp",
161    "src/root_scene.cpp",
162    "src/static_call.cpp",
163    "src/vsync_station.cpp",
164    "src/window.cpp",
165    "src/window_accessibility_controller.cpp",
166    "src/window_adapter.cpp",
167    "src/window_agent.cpp",
168    "src/window_extension_session_impl.cpp",
169    "src/window_frame_trace_impl.cpp",
170    "src/window_impl.cpp",
171    "src/window_input_channel.cpp",
172    "src/window_manager.cpp",
173    "src/window_manager_agent.cpp",
174    "src/window_option.cpp",
175    "src/window_prepare_terminate.cpp",
176    "src/window_scene.cpp",
177    "src/window_scene_session_impl.cpp",
178    "src/window_session_impl.cpp",
179    "src/zidl/window_manager_agent_stub.cpp",
180    "src/zidl/window_stub.cpp",
181  ]
182
183  configs = [
184    ":libwm_private_config",
185    "../resources/config/build:coverage_flags",
186  ]
187
188  public_configs = [ ":libwm_public_config" ]
189
190  deps = [
191    "${window_base_path}/window_scene/common:window_scene_common",
192    "${window_base_path}/window_scene/intention_event:libintention_event",
193    "${window_base_path}/window_scene/intention_event/service:intention_event_anr_manager",
194    "${window_base_path}/window_scene/session:scene_session",
195    "${window_base_path}/window_scene/session_manager:session_manager",
196    "../dm:libdm",
197    "../utils:libwmutil",
198  ]
199
200  external_deps = [
201    "ability_base:want",
202    "ability_runtime:ability_context_native",
203    "ability_runtime:ability_manager",
204    "ability_runtime:app_manager",
205    "ace_engine:ace_uicontent",
206    "c_utils:utils",
207    "eventhandler:libeventhandler",
208    "graphic_2d:librender_service_client",
209    "graphic_2d:window_animation",
210    "hilog:libhilog",
211    "hisysevent:libhisysevent",
212    "hitrace:hitrace_meter",
213    "image_framework:image_native",
214    "init:libbegetutil",
215    "input:libmmi-client",
216    "ipc:ipc_single",
217    "power_manager:powermgr_client",
218    "samgr:samgr_proxy",
219  ]
220
221  defines = []
222  if (efficiency_manager_enable) {
223    external_deps += [ "efficiency_manager:suspend_manager_client" ]
224    defines += [ "EFFICIENCY_MANAGER_ENABLE" ]
225  }
226
227  if (defined(global_parts_info)) {
228    if (defined(
229        global_parts_info.hmosresourceschedule_frame_aware_sched_override)) {
230      defines += [ "FRAME_TRACE_ENABLE" ]
231      external_deps += [ "frame_aware_sched_override:frame_trace_intf" ]
232    } else if (defined(global_parts_info.resourceschedule_frame_aware_sched)) {
233      defines += [ "FRAME_TRACE_ENABLE" ]
234      external_deps += [ "frame_aware_sched:frame_trace_intf" ]
235    }
236  }
237
238  if (defined(global_parts_info) &&
239      defined(global_parts_info.resourceschedule_resource_schedule_service)) {
240    external_deps += [ "resource_schedule_service:ressched_client" ]
241    defines += [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ]
242  }
243
244  if (!defined(global_parts_info) ||
245      defined(global_parts_info.inputmethod_imf)) {
246    imf_enable = true
247  } else {
248    imf_enable = false
249  }
250  print("imf_enable: ", imf_enable)
251
252  if (imf_enable == true) {
253    external_deps += [ "imf:inputmethod_client" ]
254    defines += [ "IMF_ENABLE" ]
255  }
256  innerapi_tags = [ "platformsdk" ]
257  part_name = "window_manager"
258  subsystem_name = "window"
259}
260
261group("test") {
262  testonly = true
263  deps = [ "test:test" ]
264}
265