1# Copyright (c) 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 17## Build libdms.so 18config("libdms_private_config") { 19 include_dirs = [ 20 "../dm/include", 21 "../interfaces/innerkits/dm", 22 ] 23} 24 25config("libdms_public_config") { 26 include_dirs = [ "include" ] 27} 28 29ohos_shared_library("libdms") { 30 branch_protector_ret = "pac_ret" 31 sanitize = { 32 cfi = true 33 cfi_cross_dso = true 34 cfi_vcall_icall_only = true 35 debug = false 36 } 37 sources = [ 38 "../dm/src/zidl/display_manager_agent_proxy.cpp", 39 "src/abstract_display.cpp", 40 "src/abstract_display_controller.cpp", 41 "src/abstract_screen.cpp", 42 "src/abstract_screen_controller.cpp", 43 "src/display_cutout_controller.cpp", 44 "src/display_dumper.cpp", 45 "src/display_manager_agent_controller.cpp", 46 "src/display_manager_config.cpp", 47 "src/display_manager_service.cpp", 48 "src/display_manager_service_inner.cpp", 49 "src/display_manager_stub.cpp", 50 "src/display_power_controller.cpp", 51 "src/screen_rotation_controller.cpp", 52 "src/sensor_connector.cpp", 53 "src/sensor_plugin.cpp", 54 ] 55 56 configs = [ 57 ":libdms_private_config", 58 "../resources/config/build:coverage_flags", 59 ] 60 61 public_configs = [ ":libdms_public_config" ] 62 63 deps = [ 64 "${window_base_path}/utils:libwmutil_base", 65 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 66 "../utils:libwmutil", 67 ] 68 69 external_deps = [ 70 "c_utils:utils", 71 "config_policy:configpolicy_util", 72 "eventhandler:libeventhandler", 73 "graphic_2d:librender_service_base", 74 "graphic_2d:librender_service_client", 75 "graphic_surface:surface", 76 "hilog:libhilog", 77 "hitrace:hitrace_meter", 78 "ipc:ipc_single", 79 "libxml2:libxml2", 80 "safwk:system_ability_fwk", 81 "samgr:samgr_proxy", 82 ] 83 84 defines = [] 85 if (window_manager_feature_subscribe_motion) { 86 if (defined(global_parts_info) && defined(global_parts_info.msdp_motion)) { 87 defines += [ "WM_SUBSCRIBE_MOTION_ENABLE" ] 88 } 89 } 90 91 if (is_standard_system) { 92 external_deps += [ "init:libbegetutil" ] 93 } else { 94 external_deps += [ "init_lite:libbegetutil" ] 95 } 96 97 if (defined(global_parts_info) && 98 defined(global_parts_info.resourceschedule_soc_perf)) { 99 external_deps += [ "soc_perf:socperf_client" ] 100 defines += [ "SOC_PERF_ENABLE" ] 101 } 102 103 if (defined(global_parts_info) && defined(global_parts_info.sensors_sensor)) { 104 external_deps += [ "sensor:sensor_interface_native" ] 105 defines += [ "SENSOR_ENABLE" ] 106 } 107 108 part_name = "window_manager" 109 subsystem_name = "window" 110 111 if (build_variant == "user") { 112 defines += [ "IS_RELEASE_VERSION" ] 113 } 114} 115 116group("test") { 117 testonly = true 118 deps = [ "test:test" ] 119} 120