1e9297d28Sopenharmony_ci# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
2e9297d28Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3e9297d28Sopenharmony_ci# you may not use this file except in compliance with the License.
4e9297d28Sopenharmony_ci# You may obtain a copy of the License at
5e9297d28Sopenharmony_ci#
6e9297d28Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7e9297d28Sopenharmony_ci#
8e9297d28Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9e9297d28Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10e9297d28Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11e9297d28Sopenharmony_ci# See the License for the specific language governing permissions and
12e9297d28Sopenharmony_ci# limitations under the License.
13e9297d28Sopenharmony_ci
14e9297d28Sopenharmony_ciimport("//build/ohos.gni")
15e9297d28Sopenharmony_ciimport("//foundation/graphic/graphic_2d/graphic_config.gni")
16e9297d28Sopenharmony_ciimport("$graphic_2d_root/rosen/modules/render_service_base/config.gni")
17e9297d28Sopenharmony_ci
18e9297d28Sopenharmony_ciconfig("render_service_link_config") {
19e9297d28Sopenharmony_ci  if (is_ohos && is_clang && (target_cpu == "arm" || target_cpu == "arm64")) {
20e9297d28Sopenharmony_ci    ldflags = [
21e9297d28Sopenharmony_ci      "-Wl,--lto-O2",
22e9297d28Sopenharmony_ci      "-Wl,-mllvm",
23e9297d28Sopenharmony_ci      "-Wl,-wholeprogramdevirt-check=fallback",
24e9297d28Sopenharmony_ci      "-Wl,-Bsymbolic",
25e9297d28Sopenharmony_ci    ]
26e9297d28Sopenharmony_ci
27e9297d28Sopenharmony_ci    if (graphic_2d_feature_enable_pgo && enable_enhanced_opt) {
28e9297d28Sopenharmony_ci      ldflags += [ "-Wl,--aarch64-inline-plt" ]
29e9297d28Sopenharmony_ci    }
30e9297d28Sopenharmony_ci  }
31e9297d28Sopenharmony_ci}
32e9297d28Sopenharmony_ci
33e9297d28Sopenharmony_ci## Build librender_service.so
34e9297d28Sopenharmony_ciohos_shared_library("librender_service") {
35e9297d28Sopenharmony_ci  branch_protector_ret = "pac_ret"
36e9297d28Sopenharmony_ci  sanitize = {
37e9297d28Sopenharmony_ci    cfi = true
38e9297d28Sopenharmony_ci    cfi_cross_dso = true
39e9297d28Sopenharmony_ci    cfi_vcall_icall_only = true
40e9297d28Sopenharmony_ci    debug = false
41e9297d28Sopenharmony_ci  }
42e9297d28Sopenharmony_ci  if (enhanced_opt) {
43e9297d28Sopenharmony_ci    configs = [ ":render_service_link_config" ]
44e9297d28Sopenharmony_ci  }
45e9297d28Sopenharmony_ci  defines = []
46e9297d28Sopenharmony_ci  if (graphic_2d_feature_color_gamut_enable) {
47e9297d28Sopenharmony_ci    defines += [ "PADDING_HEIGHT_32" ]
48e9297d28Sopenharmony_ci  } else {
49e9297d28Sopenharmony_ci    defines += []
50e9297d28Sopenharmony_ci  }
51e9297d28Sopenharmony_ci  if (use_musl) {
52e9297d28Sopenharmony_ci    defines += [ "FRAME_AWARE_TRACE" ]
53e9297d28Sopenharmony_ci  }
54e9297d28Sopenharmony_ci  if (use_video_processing_engine) {
55e9297d28Sopenharmony_ci    defines += [ "USE_VIDEO_PROCESSING_ENGINE" ]
56e9297d28Sopenharmony_ci  }
57e9297d28Sopenharmony_ci  defines += gpu_defines
58e9297d28Sopenharmony_ci  if (is_ohos && is_clang && (target_cpu == "arm" || target_cpu == "arm64")) {
59e9297d28Sopenharmony_ci    defines += [ "IS_OHOS" ]
60e9297d28Sopenharmony_ci    cflags = []
61e9297d28Sopenharmony_ci    if (!use_libfuzzer) {
62e9297d28Sopenharmony_ci      cflags += [ "-flto=thin" ]
63e9297d28Sopenharmony_ci    }
64e9297d28Sopenharmony_ci    if (enhanced_opt) {
65e9297d28Sopenharmony_ci      if (!use_libfuzzer) {
66e9297d28Sopenharmony_ci        cflags += [ "-fwhole-program-vtables" ]
67e9297d28Sopenharmony_ci      }
68e9297d28Sopenharmony_ci      if (graphic_2d_feature_enable_pgo &&
69e9297d28Sopenharmony_ci          graphic_2d_feature_product != "default") {
70e9297d28Sopenharmony_ci        cflags += [
71e9297d28Sopenharmony_ci          "-fprofile-use=" + rebase_path(
72e9297d28Sopenharmony_ci                  "${graphic_2d_feature_pgo_path}/librender_service.profdata",
73e9297d28Sopenharmony_ci                  root_build_dir),
74e9297d28Sopenharmony_ci          "-Wno-error=backend-plugin",
75e9297d28Sopenharmony_ci          "-Wno-profile-instr-out-of-date",
76e9297d28Sopenharmony_ci          "-Wno-profile-instr-unprofiled",
77e9297d28Sopenharmony_ci        ]
78e9297d28Sopenharmony_ci      }
79e9297d28Sopenharmony_ci      if (graphic_2d_feature_product == "pc" && target_cpu == "arm64") {
80e9297d28Sopenharmony_ci        cflags += [ "-moutline-atomics" ]
81e9297d28Sopenharmony_ci      }
82e9297d28Sopenharmony_ci    }
83e9297d28Sopenharmony_ci  }
84e9297d28Sopenharmony_ci
85e9297d28Sopenharmony_ci  sources = [
86e9297d28Sopenharmony_ci    "core/memory/rs_memory_manager.cpp",
87e9297d28Sopenharmony_ci    "core/pipeline/round_corner_display/rs_rcd_render_listener.cpp",
88e9297d28Sopenharmony_ci    "core/pipeline/round_corner_display/rs_rcd_render_manager.cpp",
89e9297d28Sopenharmony_ci    "core/pipeline/round_corner_display/rs_rcd_render_visitor.cpp",
90e9297d28Sopenharmony_ci    "core/pipeline/round_corner_display/rs_rcd_surface_render_node.cpp",
91e9297d28Sopenharmony_ci    "core/pipeline/round_corner_display/rs_round_corner_config.cpp",
92e9297d28Sopenharmony_ci    "core/pipeline/round_corner_display/rs_round_corner_display.cpp",
93e9297d28Sopenharmony_ci    "core/pipeline/round_corner_display/rs_round_corner_display_manager.cpp",
94e9297d28Sopenharmony_ci    "core/pipeline/rs_anco_manager.cpp",
95e9297d28Sopenharmony_ci    "core/pipeline/rs_base_render_engine.cpp",
96e9297d28Sopenharmony_ci    "core/pipeline/rs_base_render_util.cpp",
97e9297d28Sopenharmony_ci    "core/pipeline/rs_base_xml_config.cpp",
98e9297d28Sopenharmony_ci    "core/pipeline/rs_composer_adapter.cpp",
99e9297d28Sopenharmony_ci    "core/pipeline/rs_divided_render_util.cpp",
100e9297d28Sopenharmony_ci    "core/pipeline/rs_draw_frame.cpp",
101e9297d28Sopenharmony_ci    "core/pipeline/rs_draw_window_cache.cpp",
102e9297d28Sopenharmony_ci    "core/pipeline/rs_graphic_config.cpp",
103e9297d28Sopenharmony_ci    "core/pipeline/rs_hardware_thread.cpp",
104e9297d28Sopenharmony_ci    "core/pipeline/rs_main_thread.cpp",
105e9297d28Sopenharmony_ci    "core/pipeline/rs_physical_screen_processor.cpp",
106e9297d28Sopenharmony_ci    "core/pipeline/rs_pointer_window_manager.cpp",
107e9297d28Sopenharmony_ci    "core/pipeline/rs_processor.cpp",
108e9297d28Sopenharmony_ci    "core/pipeline/rs_processor_factory.cpp",
109e9297d28Sopenharmony_ci    "core/pipeline/rs_realtime_refresh_rate_manager.cpp",
110e9297d28Sopenharmony_ci    "core/pipeline/rs_render_engine.cpp",
111e9297d28Sopenharmony_ci    "core/pipeline/rs_render_service.cpp",
112e9297d28Sopenharmony_ci    "core/pipeline/rs_render_service_connection.cpp",
113e9297d28Sopenharmony_ci    "core/pipeline/rs_render_service_listener.cpp",
114e9297d28Sopenharmony_ci    "core/pipeline/rs_render_service_visitor.cpp",
115e9297d28Sopenharmony_ci    "core/pipeline/rs_surface_capture_task.cpp",
116e9297d28Sopenharmony_ci    "core/pipeline/rs_surface_capture_task_parallel.cpp",
117e9297d28Sopenharmony_ci    "core/pipeline/rs_ui_capture_task_parallel.cpp",
118e9297d28Sopenharmony_ci    "core/pipeline/rs_uifirst_manager.cpp",
119e9297d28Sopenharmony_ci    "core/pipeline/rs_uni_hwc_prevalidate_util.cpp",
120e9297d28Sopenharmony_ci    "core/pipeline/rs_uni_render_composer_adapter.cpp",
121e9297d28Sopenharmony_ci    "core/pipeline/rs_uni_render_engine.cpp",
122e9297d28Sopenharmony_ci    "core/pipeline/rs_uni_render_listener.cpp",
123e9297d28Sopenharmony_ci    "core/pipeline/rs_uni_render_processor.cpp",
124e9297d28Sopenharmony_ci    "core/pipeline/rs_uni_render_thread.cpp",
125e9297d28Sopenharmony_ci    "core/pipeline/rs_uni_render_util.cpp",
126e9297d28Sopenharmony_ci    "core/pipeline/rs_uni_render_virtual_processor.cpp",
127e9297d28Sopenharmony_ci    "core/pipeline/rs_uni_render_visitor.cpp",
128e9297d28Sopenharmony_ci    "core/pipeline/rs_uni_ui_capture.cpp",
129e9297d28Sopenharmony_ci    "core/pipeline/rs_unmarshal_thread.cpp",
130e9297d28Sopenharmony_ci    "core/pipeline/rs_vblank_idle_corrector.cpp",
131e9297d28Sopenharmony_ci    "core/pipeline/rs_virtual_screen_processor.cpp",
132e9297d28Sopenharmony_ci    "core/pipeline/rs_vsync_rate_reduce_manager.cpp",
133e9297d28Sopenharmony_ci    "core/screen_manager/rs_screen.cpp",
134e9297d28Sopenharmony_ci    "core/screen_manager/rs_screen_manager.cpp",
135e9297d28Sopenharmony_ci    "core/system/rs_system_parameters.cpp",
136e9297d28Sopenharmony_ci    "core/transaction/rs_irender_service_connection_ipc_interface_code_access_verifier.cpp",
137e9297d28Sopenharmony_ci    "core/transaction/rs_irender_service_ipc_interface_code_access_verifier.cpp",
138e9297d28Sopenharmony_ci    "core/transaction/rs_render_service_connection_stub.cpp",
139e9297d28Sopenharmony_ci    "core/transaction/rs_render_service_security_utils.cpp",
140e9297d28Sopenharmony_ci    "core/transaction/rs_render_service_stub.cpp",
141e9297d28Sopenharmony_ci  ]
142e9297d28Sopenharmony_ci
143e9297d28Sopenharmony_ci  #drawable
144e9297d28Sopenharmony_ci  sources += [
145e9297d28Sopenharmony_ci    "core/drawable/rs_canvas_drawing_render_node_drawable.cpp",
146e9297d28Sopenharmony_ci    "core/drawable/rs_canvas_render_node_drawable.cpp",
147e9297d28Sopenharmony_ci    "core/drawable/rs_display_render_node_drawable.cpp",
148e9297d28Sopenharmony_ci    "core/drawable/rs_dma_buffer_surface_render_node_drawable.cpp",
149e9297d28Sopenharmony_ci    "core/drawable/rs_effect_render_node_drawable.cpp",
150e9297d28Sopenharmony_ci    "core/drawable/rs_render_node_drawable.cpp",
151e9297d28Sopenharmony_ci    "core/drawable/rs_render_node_drawable_autocache.cpp",
152e9297d28Sopenharmony_ci    "core/drawable/rs_root_render_node_drawable.cpp",
153e9297d28Sopenharmony_ci    "core/drawable/rs_surface_render_node_drawable.cpp",
154e9297d28Sopenharmony_ci    "core/drawable/rs_ui_first_surface_render_node_drawable.cpp",
155e9297d28Sopenharmony_ci  ]
156e9297d28Sopenharmony_ci
157e9297d28Sopenharmony_ci  #dfx
158e9297d28Sopenharmony_ci  sources += [
159e9297d28Sopenharmony_ci    "core/drawable/dfx/rs_dirty_rects_dfx.cpp",
160e9297d28Sopenharmony_ci    "core/drawable/dfx/rs_skp_capture_dfx.cpp",
161e9297d28Sopenharmony_ci  ]
162e9297d28Sopenharmony_ci
163e9297d28Sopenharmony_ci  if (defined(input_ext_feature_magiccursor) && input_ext_feature_magiccursor) {
164e9297d28Sopenharmony_ci    sources += [
165e9297d28Sopenharmony_ci      "core/pipeline/magic_pointer_render/rs_magic_pointer_render_manager.cpp",
166e9297d28Sopenharmony_ci    ]
167e9297d28Sopenharmony_ci  }
168e9297d28Sopenharmony_ci
169e9297d28Sopenharmony_ci  if (rs_enable_eglimage) {
170e9297d28Sopenharmony_ci    sources += [ "core/pipeline/rs_egl_image_manager.cpp" ]
171e9297d28Sopenharmony_ci  }
172e9297d28Sopenharmony_ci
173e9297d28Sopenharmony_ci  if (graphic_2d_feature_enable_vulkan) {
174e9297d28Sopenharmony_ci    sources += [ "core/pipeline/rs_vk_image_manager.cpp" ]
175e9297d28Sopenharmony_ci  }
176e9297d28Sopenharmony_ci
177e9297d28Sopenharmony_ci  if (rs_enable_parallel_render && rs_enable_gpu) {
178e9297d28Sopenharmony_ci    sources += [
179e9297d28Sopenharmony_ci      "core/pipeline/parallel_render/rs_render_task.cpp",
180e9297d28Sopenharmony_ci      "core/pipeline/parallel_render/rs_sub_thread.cpp",
181e9297d28Sopenharmony_ci      "core/pipeline/parallel_render/rs_sub_thread_manager.cpp",
182e9297d28Sopenharmony_ci      "core/pipeline/parallel_render/rs_ui_first_render_listener.cpp",
183e9297d28Sopenharmony_ci    ]
184e9297d28Sopenharmony_ci  }
185e9297d28Sopenharmony_ci
186e9297d28Sopenharmony_ci  if (use_memmgr_plugin || use_memmgr) {
187e9297d28Sopenharmony_ci    sources += [ "core/memory/rs_app_state_listener.cpp" ]
188e9297d28Sopenharmony_ci  }
189e9297d28Sopenharmony_ci
190e9297d28Sopenharmony_ci  if (tp_feature_enable) {
191e9297d28Sopenharmony_ci    sources += [ "core/touch_screen/touch_screen.cpp" ]
192e9297d28Sopenharmony_ci  }
193e9297d28Sopenharmony_ci
194e9297d28Sopenharmony_ci  include_dirs = [
195e9297d28Sopenharmony_ci    "core",
196e9297d28Sopenharmony_ci    "core/round_corner_display",
197e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/include",
198e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/2d_graphics",
199e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/composer/vsync/include",
200e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/composer/hdi_backend/include",
201e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/frame_report/include",
202e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/render_frame_trace/include",
203e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/render_service_base/include",
204e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/render_service_base/src",
205e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/utils",
206e9297d28Sopenharmony_ci    "$graphic_2d_root/utils/log",
207e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/hyper_graphic_manager/core/config",
208e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/hyper_graphic_manager/core/frame_rate_manager",
209e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/hyper_graphic_manager/core/hgm_screen_manager",
210e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/hyper_graphic_manager/core/utils",
211e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/hyper_graphic_manager/frame_rate_vote",
212e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/create_pixelmap_surface/include",
213e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/graphics_effect/include",
214e9297d28Sopenharmony_ci  ]
215e9297d28Sopenharmony_ci  if (use_video_processing_engine) {
216e9297d28Sopenharmony_ci    include_dirs += [ "$video_processing_engine_root/interfaces/inner_api" ]
217e9297d28Sopenharmony_ci  }
218e9297d28Sopenharmony_ci
219e9297d28Sopenharmony_ci  deps = [
220e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/composer:libcomposer",
221e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/create_pixelmap_surface:create_pixelmap_surface",
222e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/graphics_effect:libgraphics_effect",
223e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/hyper_graphic_manager:libhyper_graphic_manager",
224e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/render_frame_trace:render_frame_trace",
225e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base",
226e9297d28Sopenharmony_ci  ]
227e9297d28Sopenharmony_ci
228e9297d28Sopenharmony_ci  if (graphic_2d_feature_enable_chipset_vsync) {
229e9297d28Sopenharmony_ci    defines += [ "RS_ENABLE_CHIPSET_VSYNC" ]
230e9297d28Sopenharmony_ci    deps += [ "$graphic_2d_ext_root/chipset_vsync:libchipset_vsync" ]
231e9297d28Sopenharmony_ci    include_dirs += [ "$graphic_2d_ext_root/chipset_vsync/include" ]
232e9297d28Sopenharmony_ci  }
233e9297d28Sopenharmony_ci
234e9297d28Sopenharmony_ci  if (rosen_is_ohos) {
235e9297d28Sopenharmony_ci    sources += [ "$rosen_root/modules/frame_report/src/rs_frame_report.cpp" ]
236e9297d28Sopenharmony_ci  } else if (!is_arkui_x) {
237e9297d28Sopenharmony_ci    sources +=
238e9297d28Sopenharmony_ci        [ "$rosen_root/modules/frame_report/src/mingw/rs_frame_report.cpp" ]
239e9297d28Sopenharmony_ci  }
240e9297d28Sopenharmony_ci
241e9297d28Sopenharmony_ci  #profiler
242e9297d28Sopenharmony_ci  if (rosen_is_ohos && graphic_2d_feature_rs_enable_profiler &&
243e9297d28Sopenharmony_ci      player_framework_enable) {
244e9297d28Sopenharmony_ci    defines += [ "RS_PROFILER_ENABLED" ]
245e9297d28Sopenharmony_ci    sources += [
246e9297d28Sopenharmony_ci      "$rosen_root/modules/render_service_profiler/rs_profiler.cpp",
247e9297d28Sopenharmony_ci      "$rosen_root/modules/render_service_profiler/rs_profiler_beta_recorder.cpp",
248e9297d28Sopenharmony_ci      "$rosen_root/modules/render_service_profiler/rs_profiler_capture_recorder.cpp",
249e9297d28Sopenharmony_ci      "$rosen_root/modules/render_service_profiler/rs_profiler_capturedata.cpp",
250e9297d28Sopenharmony_ci      "$rosen_root/modules/render_service_profiler/rs_profiler_command.cpp",
251e9297d28Sopenharmony_ci      "$rosen_root/modules/render_service_profiler/rs_profiler_file.cpp",
252e9297d28Sopenharmony_ci      "$rosen_root/modules/render_service_profiler/rs_profiler_network.cpp",
253e9297d28Sopenharmony_ci      "$rosen_root/modules/render_service_profiler/rs_profiler_packet.cpp",
254e9297d28Sopenharmony_ci      "$rosen_root/modules/render_service_profiler/rs_profiler_socket.cpp",
255e9297d28Sopenharmony_ci      "$rosen_root/modules/render_service_profiler/rs_profiler_telemetry.cpp",
256e9297d28Sopenharmony_ci    ]
257e9297d28Sopenharmony_ci  }
258e9297d28Sopenharmony_ci  include_dirs += [ "$graphic_2d_root/rosen/modules/render_service_profiler" ]
259e9297d28Sopenharmony_ci
260e9297d28Sopenharmony_ci  public_external_deps = [ "skia:skia_canvaskit" ]
261e9297d28Sopenharmony_ci
262e9297d28Sopenharmony_ci  if (defined(rs_enable_parallel_upload) && rs_enable_parallel_upload) {
263e9297d28Sopenharmony_ci    sources += [
264e9297d28Sopenharmony_ci      "core/pipeline/parallel_render/resource/rs_upload_resource_thread.cpp",
265e9297d28Sopenharmony_ci    ]
266e9297d28Sopenharmony_ci    include_dirs += [ "$graphic_2d_root/rosen/modules/render_service/core/pipeline/parallel_render/resource" ]
267e9297d28Sopenharmony_ci    if (defined(use_rosen_drawing) && use_rosen_drawing) {
268e9297d28Sopenharmony_ci      sources += [
269e9297d28Sopenharmony_ci        "core/pipeline/parallel_render/resource/rs_resource_helper_drawing.cpp",
270e9297d28Sopenharmony_ci      ]
271e9297d28Sopenharmony_ci    } else {
272e9297d28Sopenharmony_ci      sources += [
273e9297d28Sopenharmony_ci        "core/pipeline/parallel_render/resource/rs_resource_helper_skia.cpp",
274e9297d28Sopenharmony_ci      ]
275e9297d28Sopenharmony_ci    }
276e9297d28Sopenharmony_ci  }
277e9297d28Sopenharmony_ci
278e9297d28Sopenharmony_ci  if (rs_enable_gpu) {
279e9297d28Sopenharmony_ci    public_deps = [ "$graphic_2d_root:libvulkan" ]
280e9297d28Sopenharmony_ci  }
281e9297d28Sopenharmony_ci
282e9297d28Sopenharmony_ci  if (defined(use_rosen_drawing) && use_rosen_drawing) {
283e9297d28Sopenharmony_ci    defines += [ "USE_ROSEN_DRAWING" ]
284e9297d28Sopenharmony_ci    if (rs_enable_gpu) {
285e9297d28Sopenharmony_ci      defines += [ "RS_ENABLE_GPU" ]
286e9297d28Sopenharmony_ci    }
287e9297d28Sopenharmony_ci    deps += [ "$rosen_root/modules/2d_graphics:2d_graphics" ]
288e9297d28Sopenharmony_ci  }
289e9297d28Sopenharmony_ci
290e9297d28Sopenharmony_ci  public_external_deps += [ "libxml2:libxml2" ]
291e9297d28Sopenharmony_ci
292e9297d28Sopenharmony_ci  external_deps = [
293e9297d28Sopenharmony_ci    "ability_runtime:app_manager",
294e9297d28Sopenharmony_ci    "cJSON:cjson",
295e9297d28Sopenharmony_ci    "c_utils:utils",
296e9297d28Sopenharmony_ci    "config_policy:configpolicy_util",
297e9297d28Sopenharmony_ci    "drivers_interface_display:libdisplay_commontype_proxy_1.0",
298e9297d28Sopenharmony_ci    "eventhandler:libeventhandler",
299e9297d28Sopenharmony_ci    "ffrt:libffrt",
300e9297d28Sopenharmony_ci    "graphic_surface:frame_report",
301e9297d28Sopenharmony_ci    "graphic_surface:surface",
302e9297d28Sopenharmony_ci    "hicollie:libhicollie",
303e9297d28Sopenharmony_ci    "hilog:libhilog",
304e9297d28Sopenharmony_ci    "hisysevent:libhisysevent",
305e9297d28Sopenharmony_ci    "hitrace:hitrace_meter",
306e9297d28Sopenharmony_ci    "init:libbegetutil",
307e9297d28Sopenharmony_ci    "ipc:ipc_core",
308e9297d28Sopenharmony_ci    "libpng:libpng",
309e9297d28Sopenharmony_ci    "qos_manager:qos",
310e9297d28Sopenharmony_ci    "safwk:system_ability_fwk",
311e9297d28Sopenharmony_ci    "samgr:samgr_proxy",
312e9297d28Sopenharmony_ci    "window_manager:libwsutils",
313e9297d28Sopenharmony_ci  ]
314e9297d28Sopenharmony_ci  if (use_video_processing_engine) {
315e9297d28Sopenharmony_ci    external_deps += [ "video_processing_engine:videoprocessingengine" ]
316e9297d28Sopenharmony_ci  }
317e9297d28Sopenharmony_ci
318e9297d28Sopenharmony_ci  if (defined(ddgr_ext_configs)) {
319e9297d28Sopenharmony_ci    libs = ddgr_ext_configs.ddgr_libs
320e9297d28Sopenharmony_ci    defines += ddgr_ext_configs.ddgr_defines
321e9297d28Sopenharmony_ci    sources += ddgr_ext_configs.libddgr_ext_adaptor_sources
322e9297d28Sopenharmony_ci    include_dirs += ddgr_ext_configs.libddgr_ext_adaptor_include_dirs
323e9297d28Sopenharmony_ci  }
324e9297d28Sopenharmony_ci
325e9297d28Sopenharmony_ci  if (rosen_is_ohos) {
326e9297d28Sopenharmony_ci    external_deps += [ "image_framework:image_native" ]
327e9297d28Sopenharmony_ci  }
328e9297d28Sopenharmony_ci
329e9297d28Sopenharmony_ci  if (defined(global_parts_info) &&
330e9297d28Sopenharmony_ci      defined(global_parts_info.resourceschedule_soc_perf)) {
331e9297d28Sopenharmony_ci    external_deps += [ "soc_perf:socperf_client" ]
332e9297d28Sopenharmony_ci    defines += [ "SOC_PERF_ENABLE" ]
333e9297d28Sopenharmony_ci  }
334e9297d28Sopenharmony_ci
335e9297d28Sopenharmony_ci  if (defined(global_parts_info) &&
336e9297d28Sopenharmony_ci      defined(global_parts_info.resourceschedule_resource_schedule_service)) {
337e9297d28Sopenharmony_ci    external_deps += [ "resource_schedule_service:ressched_client" ]
338e9297d28Sopenharmony_ci    defines += [ "RES_SCHED_ENABLE" ]
339e9297d28Sopenharmony_ci  }
340e9297d28Sopenharmony_ci
341e9297d28Sopenharmony_ci  if (defined(global_parts_info) && defined(global_parts_info.sensors_sensor)) {
342e9297d28Sopenharmony_ci    external_deps += [ "sensor:sensor_interface_native" ]
343e9297d28Sopenharmony_ci    defines += [ "RS_SUBSCRIBE_SENSOR_ENABLE" ]
344e9297d28Sopenharmony_ci  }
345e9297d28Sopenharmony_ci
346e9297d28Sopenharmony_ci  if (accessibility_enable) {
347e9297d28Sopenharmony_ci    external_deps += [ "accessibility:accessibilityconfig" ]
348e9297d28Sopenharmony_ci    external_deps += [ "accessibility:accessibility_common" ]
349e9297d28Sopenharmony_ci    defines += accessibility_defines
350e9297d28Sopenharmony_ci  }
351e9297d28Sopenharmony_ci
352e9297d28Sopenharmony_ci  if (use_memmgr_plugin) {
353e9297d28Sopenharmony_ci    external_deps += [ "memmgr:memmgrclient" ]
354e9297d28Sopenharmony_ci  } else if (use_memmgr) {
355e9297d28Sopenharmony_ci    external_deps += [ "memmgr:memmgrclient" ]
356e9297d28Sopenharmony_ci  }
357e9297d28Sopenharmony_ci
358e9297d28Sopenharmony_ci  if (rosen_is_ohos && defined(enable_ipc_security) && enable_ipc_security) {
359e9297d28Sopenharmony_ci    defines += [ "ENABLE_IPC_SECURITY" ]
360e9297d28Sopenharmony_ci    external_deps += [
361e9297d28Sopenharmony_ci      "access_token:libaccesstoken_sdk",
362e9297d28Sopenharmony_ci      "access_token:libtokenid_sdk",
363e9297d28Sopenharmony_ci    ]
364e9297d28Sopenharmony_ci  }
365e9297d28Sopenharmony_ci
366e9297d28Sopenharmony_ci  if (rosen_is_ohos && defined(enable_ipc_security_access_counter) &&
367e9297d28Sopenharmony_ci      enable_ipc_security_access_counter) {
368e9297d28Sopenharmony_ci    defines += [ "ENABLE_IPC_SECURITY_ACCESS_COUNTER" ]
369e9297d28Sopenharmony_ci  }
370e9297d28Sopenharmony_ci
371e9297d28Sopenharmony_ci  if (tp_feature_enable) {
372e9297d28Sopenharmony_ci    defines += tp_defines
373e9297d28Sopenharmony_ci  }
374e9297d28Sopenharmony_ci
375e9297d28Sopenharmony_ci  part_name = "graphic_2d"
376e9297d28Sopenharmony_ci  subsystem_name = "graphic"
377e9297d28Sopenharmony_ci}
378e9297d28Sopenharmony_ci
379e9297d28Sopenharmony_ci## Build render_service.bin
380e9297d28Sopenharmony_ciohos_executable("render_service") {
381e9297d28Sopenharmony_ci  branch_protector_ret = "pac_ret"
382e9297d28Sopenharmony_ci  sanitize = {
383e9297d28Sopenharmony_ci    cfi = true
384e9297d28Sopenharmony_ci    cfi_cross_dso = true
385e9297d28Sopenharmony_ci    cfi_vcall_icall_only = true
386e9297d28Sopenharmony_ci    debug = false
387e9297d28Sopenharmony_ci    if (rosen_is_ohos) {
388e9297d28Sopenharmony_ci      boundary_sanitize = true
389e9297d28Sopenharmony_ci      integer_overflow = true
390e9297d28Sopenharmony_ci      ubsan = true
391e9297d28Sopenharmony_ci    }
392e9297d28Sopenharmony_ci  }
393e9297d28Sopenharmony_ci  sources = [ "core/main.cpp" ]
394e9297d28Sopenharmony_ci
395e9297d28Sopenharmony_ci  include_dirs = [
396e9297d28Sopenharmony_ci    "core",
397e9297d28Sopenharmony_ci    "$graphic_2d_root/interfaces/inner_api/common",
398e9297d28Sopenharmony_ci    "$graphic_2d_root/utils/color_manager/export",
399e9297d28Sopenharmony_ci  ]
400e9297d28Sopenharmony_ci
401e9297d28Sopenharmony_ci  deps = [
402e9297d28Sopenharmony_ci    ":librender_service",
403e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/composer:libcomposer",
404e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/hyper_graphic_manager:libhyper_graphic_manager",
405e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base",
406e9297d28Sopenharmony_ci  ]
407e9297d28Sopenharmony_ci
408e9297d28Sopenharmony_ci  external_deps = [
409e9297d28Sopenharmony_ci    "c_utils:utils",
410e9297d28Sopenharmony_ci    "drivers_interface_display:libdisplay_commontype_proxy_1.0",
411e9297d28Sopenharmony_ci    "hilog:libhilog",
412e9297d28Sopenharmony_ci    "ipc:ipc_core",
413e9297d28Sopenharmony_ci  ]
414e9297d28Sopenharmony_ci
415e9297d28Sopenharmony_ci  if (defined(global_parts_info) && defined(global_parts_info.sensors_sensor)) {
416e9297d28Sopenharmony_ci    external_deps += [ "sensor:sensor_interface_native" ]
417e9297d28Sopenharmony_ci  }
418e9297d28Sopenharmony_ci
419e9297d28Sopenharmony_ci  part_name = "graphic_2d"
420e9297d28Sopenharmony_ci  subsystem_name = "graphic"
421e9297d28Sopenharmony_ci}
422