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