• 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  ]
26}
27
28config("libwm_public_config") {
29  include_dirs = [
30    "../interfaces/innerkits",
31    "../interfaces/innerkits/dm",
32    "../interfaces/innerkits/wm",
33    "../utils/include",
34    "../window_scene",
35  ]
36}
37
38## Build libwm_static.a
39ohos_static_library("libwm_static") {
40  branch_protector_ret = "pac_ret"
41  sanitize = {
42    cfi = true
43    cfi_cross_dso = true
44    cfi_vcall_icall_only = true
45    debug = false
46    integer_overflow = true
47    ubsan = true
48    boundary_sanitize = true
49  }
50  include_dirs = [
51    "../utils/include",
52    "../window_scene/intention_event/service/anr_manager/include",
53    "../window_scene/intention_event/framework/anr_handler/include",
54    "${window_base_path}/interfaces/innerkits/dm",
55    "${window_base_path}/window_scene/intention_event/include",
56  ]
57
58  sources = [
59    "../wmserver/src/zidl/window_manager_proxy.cpp",
60    "src/extension_window.cpp",
61    "src/extension_window_impl.cpp",
62    "src/future_callback.cpp",
63    "src/gtx_input_event_sender.cpp",
64    "src/input_transfer_station.cpp",
65    "src/pattern_detach_callback.cpp",
66    "src/picture_in_picture_controller.cpp",
67    "src/picture_in_picture_manager.cpp",
68    "src/picture_in_picture_option.cpp",
69    "src/root_scene.cpp",
70    "src/screen_scene.cpp",
71    "src/static_call.cpp",
72    "src/ui_extension/provider_data_handler.cpp",
73    "src/vsync_station.cpp",
74    "src/window.cpp",
75    "src/window_accessibility_controller.cpp",
76    "src/window_adapter.cpp",
77    "src/window_agent.cpp",
78    "src/window_display_change_adapter.cpp",
79    "src/window_extension_session_impl.cpp",
80    "src/window_frame_trace_impl.cpp",
81    "src/window_impl.cpp",
82    "src/window_input_channel.cpp",
83    "src/window_manager.cpp",
84    "src/window_manager_agent.cpp",
85    "src/window_option.cpp",
86    "src/window_prepare_terminate.cpp",
87    "src/window_scene.cpp",
88    "src/window_scene_session_impl.cpp",
89    "src/window_session_impl.cpp",
90    "src/zidl/pattern_detach_callback_proxy.cpp",
91    "src/zidl/pattern_detach_callback_stub.cpp",
92    "src/zidl/window_manager_agent_stub.cpp",
93    "src/zidl/window_stub.cpp",
94  ]
95
96  configs = [
97    ":libwm_private_config",
98    "${window_base_path}/resources/config/build:coverage_flags",
99  ]
100
101  public_configs = [ ":libwm_public_config" ]
102
103  deps = [
104    "${window_base_path}/dm:libdm",
105    "${window_base_path}/utils:libwmutil",
106    "${window_base_path}/utils:libwmutil_base",
107    "${window_base_path}/window_scene/common:window_scene_common",
108    "${window_base_path}/window_scene/intention_event:libintention_event",
109    "${window_base_path}/window_scene/intention_event/service:intention_event_anr_manager",
110    "${window_base_path}/window_scene/interfaces/innerkits:libwsutils",
111    "${window_base_path}/window_scene/session:scene_session",
112    "${window_base_path}/window_scene/session_manager:session_manager",
113  ]
114
115  external_deps = [
116    "ability_base:configuration",
117    "ability_base:want",
118    "ability_runtime:ability_context_native",
119    "ability_runtime:ability_manager",
120    "ability_runtime:app_manager",
121    "accessibility:accessibility_common",
122    "ace_engine:ace_uicontent",
123    "ace_engine:ace_xcomponent_controller",
124    "bundle_framework:appexecfwk_core",
125    "c_utils:utils",
126    "eventhandler:libeventhandler",
127    "graphic_2d:librender_service_client",
128    "graphic_2d:window_animation",
129    "hilog:libhilog",
130    "hisysevent:libhisysevent",
131    "hitrace:hitrace_meter",
132    "image_framework:image_native",
133    "init:libbegetutil",
134    "input:libmmi-client",
135    "ipc:ipc_single",
136    "napi:ace_napi",
137    "samgr:samgr_proxy",
138  ]
139
140  defines = []
141
142  if (defined(global_parts_info) &&
143      defined(global_parts_info.barrierfree_accessibility)) {
144    external_deps += [ "accessibility:accessibility_common" ]
145  }
146
147  defines += [ "FRAME_TRACE_ENABLE" ]
148  external_deps += [ "frame_aware_sched:frame_trace_intf" ]
149
150  if (defined(global_parts_info) &&
151      defined(global_parts_info.resourceschedule_resource_schedule_service)) {
152    external_deps += [ "resource_schedule_service:ressched_client" ]
153    defines += [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ]
154  }
155
156  if (defined(global_parts_info) &&
157      defined(global_parts_info.powermgr_power_manager)) {
158    external_deps += [ "power_manager:powermgr_client" ]
159    defines += [ "POWER_MANAGER_ENABLE" ]
160  }
161
162  if (!defined(global_parts_info) ||
163      defined(global_parts_info.inputmethod_imf)) {
164    imf_enable = true
165  } else {
166    imf_enable = false
167  }
168  print("imf_enable: ", imf_enable)
169
170  if (imf_enable == true) {
171    external_deps += [ "imf:inputmethod_client" ]
172    defines += [ "IMF_ENABLE" ]
173  }
174
175  part_name = "window_manager"
176  subsystem_name = "window"
177}
178
179## Build libwm.so
180ohos_shared_library("libwm") {
181  branch_protector_ret = "pac_ret"
182  sanitize = {
183    cfi = true
184    cfi_cross_dso = true
185    cfi_vcall_icall_only = true
186    debug = false
187  }
188  include_dirs = [
189    "../utils/include",
190    "../window_scene/intention_event/service/anr_manager/include",
191    "../window_scene/intention_event/framework/anr_handler/include",
192    "${window_base_path}/interfaces/innerkits/dm",
193    "${window_base_path}/window_scene/intention_event/include",
194  ]
195
196  sources = [
197    "../wmserver/src/zidl/window_manager_proxy.cpp",
198    "src/extension_window.cpp",
199    "src/extension_window_impl.cpp",
200    "src/future_callback.cpp",
201    "src/gtx_input_event_sender.cpp",
202    "src/input_transfer_station.cpp",
203    "src/pattern_detach_callback.cpp",
204    "src/picture_in_picture_controller.cpp",
205    "src/picture_in_picture_manager.cpp",
206    "src/picture_in_picture_option.cpp",
207    "src/root_scene.cpp",
208    "src/screen_scene.cpp",
209    "src/static_call.cpp",
210    "src/ui_extension/provider_data_handler.cpp",
211    "src/vsync_station.cpp",
212    "src/window.cpp",
213    "src/window_accessibility_controller.cpp",
214    "src/window_adapter.cpp",
215    "src/window_agent.cpp",
216    "src/window_display_change_adapter.cpp",
217    "src/window_extension_session_impl.cpp",
218    "src/window_frame_trace_impl.cpp",
219    "src/window_impl.cpp",
220    "src/window_input_channel.cpp",
221    "src/window_manager.cpp",
222    "src/window_manager_agent.cpp",
223    "src/window_option.cpp",
224    "src/window_prepare_terminate.cpp",
225    "src/window_scene.cpp",
226    "src/window_scene_session_impl.cpp",
227    "src/window_session_impl.cpp",
228    "src/zidl/pattern_detach_callback_proxy.cpp",
229    "src/zidl/pattern_detach_callback_stub.cpp",
230    "src/zidl/window_manager_agent_stub.cpp",
231    "src/zidl/window_stub.cpp",
232  ]
233
234  configs = [
235    ":libwm_private_config",
236    "../resources/config/build:coverage_flags",
237  ]
238
239  public_configs = [ ":libwm_public_config" ]
240
241  deps = [
242    "${window_base_path}/utils:libwmutil",
243    "${window_base_path}/utils:libwmutil_base",
244    "${window_base_path}/window_scene/common:window_scene_common",
245    "${window_base_path}/window_scene/intention_event:libintention_event",
246    "${window_base_path}/window_scene/intention_event/service:intention_event_anr_manager",
247    "${window_base_path}/window_scene/interfaces/innerkits:libwsutils",
248    "${window_base_path}/window_scene/session:scene_session",
249    "${window_base_path}/window_scene/session_manager:session_manager",
250    "../dm:libdm",
251  ]
252
253  external_deps = [
254    "ability_base:configuration",
255    "ability_base:want",
256    "ability_runtime:ability_context_native",
257    "ability_runtime:ability_manager",
258    "ability_runtime:app_context",
259    "ability_runtime:app_manager",
260    "accessibility:accessibility_common",
261    "ace_engine:ace_uicontent",
262    "ace_engine:ace_xcomponent_controller",
263    "bundle_framework:appexecfwk_core",
264    "c_utils:utils",
265    "eventhandler:libeventhandler",
266    "graphic_2d:librender_service_client",
267    "graphic_2d:window_animation",
268    "hilog:libhilog",
269    "hisysevent:libhisysevent",
270    "hitrace:hitrace_meter",
271    "image_framework:image_native",
272    "init:libbegetutil",
273    "input:libmmi-client",
274    "ipc:ipc_single",
275    "napi:ace_napi",
276    "samgr:samgr_proxy",
277  ]
278
279  defines = []
280
281  if (defined(global_parts_info) &&
282      defined(global_parts_info.barrierfree_accessibility)) {
283    external_deps += [ "accessibility:accessibility_common" ]
284  }
285
286  defines += [ "FRAME_TRACE_ENABLE" ]
287  external_deps += [ "frame_aware_sched:frame_trace_intf" ]
288
289  if (defined(global_parts_info) &&
290      defined(global_parts_info.resourceschedule_resource_schedule_service)) {
291    external_deps += [ "resource_schedule_service:ressched_client" ]
292    defines += [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ]
293  }
294
295  if (!defined(global_parts_info) ||
296      defined(global_parts_info.inputmethod_imf)) {
297    imf_enable = true
298  } else {
299    imf_enable = false
300  }
301
302  if (defined(global_parts_info) &&
303      defined(global_parts_info.powermgr_power_manager)) {
304    external_deps += [ "power_manager:powermgr_client" ]
305    defines += [ "POWER_MANAGER_ENABLE" ]
306  }
307  print("imf_enable: ", imf_enable)
308
309  if (imf_enable == true) {
310    external_deps += [ "imf:inputmethod_client" ]
311    defines += [ "IMF_ENABLE" ]
312  }
313
314  part_name = "window_manager"
315  subsystem_name = "window"
316
317  if (build_variant == "user") {
318    defines += [ "IS_RELEASE_VERSION" ]
319  }
320}
321
322## Build libwm_lite.so
323ohos_shared_library("libwm_lite") {
324  defines = [ "USE_ADAPTER_LITE" ]
325  include_dirs = [
326    "../interfaces/innerkits/wm",
327    "../utils/include",
328  ]
329  sources = [
330    "../utils/src/window_visibility_info.cpp",
331    "src/window_adapter_lite.cpp",
332    "src/window_manager_agent_lite.cpp",
333    "src/window_manager_lite.cpp",
334    "src/window_option.cpp",
335    "src/zidl/window_manager_agent_stub.cpp",
336  ]
337
338  configs = [
339    ":libwm_private_config",
340    "../resources/config/build:coverage_flags",
341  ]
342
343  deps = [
344    "${window_base_path}/utils:libwmutil_base",
345    "${window_base_path}/window_scene/interfaces/innerkits:libwsutils",
346    "${window_base_path}/window_scene/session_manager:session_manager_lite",
347  ]
348
349  public_configs = [ ":libwm_public_config" ]
350
351  external_deps = [
352    "ability_runtime:ability_manager",
353    "accessibility:accessibility_common",
354    "bundle_framework:appexecfwk_core",
355    "c_utils:utils",
356    "hilog:libhilog",
357    "image_framework:image_native",
358    "init:libbegetutil",
359    "ipc:ipc_single",
360    "samgr:samgr_proxy",
361  ]
362
363  defines += [ "FRAME_TRACE_ENABLE" ]
364  external_deps += [ "frame_aware_sched:frame_trace_intf" ]
365
366  if (defined(global_parts_info) &&
367      defined(global_parts_info.resourceschedule_resource_schedule_service)) {
368    external_deps += [ "resource_schedule_service:ressched_client" ]
369    defines += [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ]
370  }
371
372  if (!defined(global_parts_info) ||
373      defined(global_parts_info.inputmethod_imf)) {
374    imf_enable = true
375  } else {
376    imf_enable = false
377  }
378
379  if (defined(global_parts_info) &&
380      defined(global_parts_info.powermgr_power_manager)) {
381    external_deps += [ "power_manager:powermgr_client" ]
382    defines += [ "POWER_MANAGER_ENABLE" ]
383  }
384  print("imf_enable: ", imf_enable)
385
386  if (imf_enable == true) {
387    external_deps += [ "imf:inputmethod_client" ]
388    defines += [ "IMF_ENABLE" ]
389  }
390
391  part_name = "window_manager"
392  subsystem_name = "window"
393
394  if (build_variant == "user") {
395    defines += [ "IS_RELEASE_VERSION" ]
396  }
397}
398
399group("test") {
400  testonly = true
401  deps = [ "test:test" ]
402}
403
404## Build libwm_ndk.so
405ohos_shared_library("libwm_ndk") {
406  output_name = "libnative_window_manager"
407  output_extension = "so"
408  branch_protector_ret = "pac_ret"
409
410  sanitize = {
411    cfi = true
412    cfi_cross_dso = true
413    cfi_vcall_icall_only = true
414    debug = false
415  }
416
417  include_dirs = [
418    "${window_base_path}/interfaces/kits/ndk/wm",
419    "${window_base_path}/interfaces/inner_kits/wm",
420  ]
421
422  sources = [
423    "src/oh_window.cpp",
424    "src/oh_window_event_filter.cpp",
425  ]
426
427  deps = [ ":libwm" ]
428  innerapi_tags = [ "ndk" ]
429
430  external_deps = [
431    "ace_engine:ace_uicontent",
432    "c_utils:utils",
433    "eventhandler:libeventhandler",
434    "graphic_2d:librender_service_client",
435    "hilog:libhilog",
436    "image_framework:pixelmap",
437    "input:libmmi-client",
438    "input:oh_input_manager",
439  ]
440
441  part_name = "window_manager"
442  subsystem_name = "window"
443}
444