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("libdm_private_config") { 18 include_dirs = [ 19 "include", 20 "../dmserver/include", 21 "${window_base_path}/interfaces/innerkits/wm", 22 "${window_base_path}/window_scene", 23 "${window_base_path}/window_scene/screen_session_manager/include", 24 "${window_base_path}/window_scene/session_manager/include", 25 "${window_base_path}/window_scene/session_manager_service/include", 26 "${window_base_path}/window_scene/interfaces/innerkits/include", 27 ] 28} 29 30config("libdm_public_config") { 31 include_dirs = [ 32 "../interfaces/innerkits", 33 "../interfaces/innerkits/dm", 34 "../utils/include", 35 ] 36} 37 38config("for_libdm_public_config") { 39 include_dirs = 40 [ "../../../multimedia/image_framework/interfaces/innerkits/include" ] 41} 42 43## Build libdm_static.a 44ohos_static_library("libdm_static") { 45 branch_protector_ret = "pac_ret" 46 sanitize = { 47 cfi = true 48 cfi_cross_dso = true 49 cfi_vcall_icall_only = true 50 debug = false 51 integer_overflow = true 52 ubsan = true 53 boundary_sanitize = true 54 } 55 sources = [ 56 "../dmserver/src/display_manager_proxy.cpp", 57 "../window_scene/session_manager/src/zidl/screen_session_manager_proxy.cpp", 58 "src/display.cpp", 59 "src/display_manager.cpp", 60 "src/display_manager_adapter.cpp", 61 "src/screen.cpp", 62 "src/screen_group.cpp", 63 "src/screen_manager.cpp", 64 "src/zidl/display_manager_agent_stub.cpp", 65 ] 66 67 configs = [ 68 ":libdm_private_config", 69 "${window_base_path}/resources/config/build:coverage_flags", 70 ] 71 72 public_configs = [ ":libdm_public_config" ] 73 74 deps = [ 75 "${window_base_path}/utils:libwmutil", 76 "${window_base_path}/utils:libwmutil_base", 77 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 78 ] 79 80 public_external_deps = [ 81 "graphic_2d:color_manager", 82 "image_framework:image_native", 83 ] 84 85 external_deps = [ 86 "ability_runtime:ability_manager", 87 "c_utils:utils", 88 "graphic_2d:librender_service_client", 89 "hilog:libhilog", 90 "image_framework:image_native", 91 "ipc:ipc_single", 92 "samgr:samgr_proxy", 93 ] 94 95 part_name = "window_manager" 96 subsystem_name = "window" 97} 98 99## Build libdm.so 100ohos_shared_library("libdm") { 101 branch_protector_ret = "pac_ret" 102 sources = [ 103 "../dmserver/src/display_manager_proxy.cpp", 104 "../window_scene/session_manager/src/zidl/screen_session_manager_proxy.cpp", 105 "src/display.cpp", 106 "src/display_manager.cpp", 107 "src/display_manager_adapter.cpp", 108 "src/screen.cpp", 109 "src/screen_group.cpp", 110 "src/screen_manager.cpp", 111 "src/zidl/display_manager_agent_stub.cpp", 112 ] 113 114 configs = [ 115 ":libdm_private_config", 116 "../resources/config/build:coverage_flags", 117 ] 118 119 public_configs = [ 120 ":for_libdm_public_config", 121 ":libdm_public_config", 122 ] 123 124 deps = [ 125 "${window_base_path}/utils:libwmutil", 126 "${window_base_path}/utils:libwmutil_base", 127 "${window_base_path}/window_scene/interfaces/innerkits:libwsutils", 128 ] 129 130 public_external_deps = [ "graphic_2d:color_manager" ] 131 132 external_deps = [ 133 "ability_runtime:ability_manager", 134 "c_utils:utils", 135 "graphic_2d:librender_service_client", 136 "hilog:libhilog", 137 "image_framework:image_native", 138 "ipc:ipc_single", 139 "samgr:samgr_proxy", 140 ] 141 142 part_name = "window_manager" 143 subsystem_name = "window" 144 145 defines = [] 146 if (build_variant == "user") { 147 defines += [ "IS_RELEASE_VERSION" ] 148 } 149} 150 151group("test") { 152 testonly = true 153 deps = [ "test:test" ] 154} 155 156## Build libdm_ndk.so 157config("libdm_ndk_public_config") { 158 include_dirs = [ "../interfaces/kits/dmndk/dm" ] 159} 160 161ohos_shared_library("libdm_ndk") { 162 branch_protector_ret = "pac_ret" 163 output_name = "libnative_display_manager" 164 output_extension = "so" 165 166 sanitize = { 167 cfi = true 168 cfi_cross_dso = true 169 cfi_vcall_icall_only = true 170 debug = false 171 } 172 173 public_configs = [ ":libdm_ndk_public_config" ] 174 175 include_dirs = [ 176 ".", 177 "${window_base_path}/interfaces/kits/dmndk/dm", 178 "${window_base_path}/interfaces/inner_kits/dm", 179 ] 180 181 sources = [ "src/oh_display_manager.cpp" ] 182 183 deps = [ ":libdm" ] 184 innerapi_tags = [ "ndk" ] 185 186 external_deps = [ 187 "c_utils:utils", 188 "hilog:libhilog", 189 "image_framework:pixelmap", 190 "ipc:ipc_core", 191 ] 192 193 part_name = "window_manager" 194 subsystem_name = "window" 195} 196