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