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 ] 54 55 configs = [ 56 ":libdms_private_config", 57 "../resources/config/build:coverage_flags", 58 ] 59 60 public_configs = [ ":libdms_public_config" ] 61 62 deps = [ 63 "${window_base_path}/utils:libwmutil_base", 64 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 65 "../utils:libwmutil", 66 ] 67 68 external_deps = [ 69 "c_utils:utils", 70 "config_policy:configpolicy_util", 71 "eventhandler:libeventhandler", 72 "graphic_2d:librender_service_client", 73 "graphic_surface:surface", 74 "hilog:libhilog", 75 "hitrace:hitrace_meter", 76 "ipc:ipc_single", 77 "libxml2:libxml2", 78 "safwk:system_ability_fwk", 79 ] 80 81 defines = [] 82 if (window_manager_feature_subscribe_motion) { 83 if (defined(global_parts_info) && defined(global_parts_info.msdp_motion)) { 84 external_deps += [ "motion:motion_interface_native" ] 85 defines += [ "WM_SUBSCRIBE_MOTION_ENABLE" ] 86 } 87 } 88 89 if (is_standard_system) { 90 external_deps += [ "init:libbegetutil" ] 91 } else { 92 external_deps += [ "init_lite:libbegetutil" ] 93 } 94 95 if (defined(global_parts_info) && 96 defined(global_parts_info.resourceschedule_soc_perf)) { 97 external_deps += [ "soc_perf:socperf_client" ] 98 defines += [ "SOC_PERF_ENABLE" ] 99 } 100 101 if (defined(global_parts_info) && defined(global_parts_info.sensors_sensor)) { 102 external_deps += [ "sensor:sensor_interface_native" ] 103 defines += [ "SENSOR_ENABLE" ] 104 } 105 106 part_name = "window_manager" 107 subsystem_name = "window" 108 109 if (build_variant == "user") { 110 defines += [ "IS_RELEASE_VERSION" ] 111 } 112} 113 114group("test") { 115 testonly = true 116 deps = [ "test:test" ] 117} 118