1# Copyright (c) 2022-2024 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("//build/ohos_var.gni")
16import(
17    "//foundation/distributedhardware/distributed_screen/distributedscreen.gni")
18
19ohos_shared_library("distributed_screen_source") {
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    debug = false
24    boundary_sanitize = true
25    integer_overflow = true
26    ubsan = true
27  }
28  branch_protector_ret = "pac_ret"
29  include_dirs = [
30    "./dscreenservice/include",
31    "./dscreenservice/include/callback",
32    "${services_path}/screenservice/sourceservice/dscreenmgr",
33    "${services_path}/screenservice/sourceservice/dscreenmgr/common/include",
34    "${interfaces_path}/innerkits/native_cpp/screen_sink/include",
35    "${interfaces_path}/innerkits/native_cpp/screen_sink/include/callback",
36    "${interfaces_path}/innerkits/native_cpp/screen_source/include",
37    "${interfaces_path}/innerkits/native_cpp/screen_source/include/callback",
38    "${common_path}/include",
39    "${services_path}/common/utils/include",
40    "${services_path}/common/databuffer/include",
41    "${services_path}/common/screen_channel/include",
42    "${services_path}/screentransport/screensourceprocessor/include",
43    "${services_path}/screentransport/screensourceprocessor/encoder/include",
44    "${services_path}/screentransport/screensourcetrans/include",
45    "${services_path}/common/imageJpeg/include",
46    "${services_path}/common/decision_center/include",
47  ]
48
49  sources = [
50    "${interfaces_path}/innerkits/native_cpp/screen_sink/src/dscreen_sink_proxy.cpp",
51    "${interfaces_path}/innerkits/native_cpp/screen_source/src/dscreen_source_proxy.cpp",
52    "${services_path}/common/utils/src/dscreen_fwkkit.cpp",
53    "${services_path}/common/utils/src/dscreen_hidumper.cpp",
54    "${services_path}/common/utils/src/dscreen_maprelation.cpp",
55    "${services_path}/common/utils/src/video_param.cpp",
56    "./dscreenmgr/1.0/src/dscreen.cpp",
57    "./dscreenmgr/1.0/src/dscreen_manager.cpp",
58    "./dscreenmgr/2.0/src/av_sender_engine_adapter.cpp",
59    "./dscreenmgr/2.0/src/dscreen.cpp",
60    "./dscreenmgr/2.0/src/dscreen_manager.cpp",
61    "./dscreenmgr/common/src/screen_manager_adapter.cpp",
62    "./dscreenservice/src/callback/dscreen_source_callback_proxy.cpp",
63    "./dscreenservice/src/dscreen_source_service.cpp",
64    "./dscreenservice/src/dscreen_source_stub.cpp",
65  ]
66
67  deps = [
68    "${common_path}:distributed_screen_utils",
69    "${services_path}/screentransport/screensourcetrans:distributed_screen_sourcetrans",
70  ]
71
72  defines = [
73    "HI_LOG_ENABLE",
74    "DH_LOG_TAG=\"dscreensource\"",
75    "LOG_DOMAIN=0xD004140",
76  ]
77
78  if (build_variant == "root") {
79    defines += [ "DUMP_DSCREEN_FILE" ]
80  }
81
82  external_deps = [
83    "access_token:libaccesstoken_sdk",
84    "access_token:libtokenid_sdk",
85    "av_codec:av_codec_client",
86    "cJSON:cjson",
87    "c_utils:utils",
88    "distributed_hardware_fwk:distributed_av_sender",
89    "distributed_hardware_fwk:distributedhardwareutils",
90    "distributed_hardware_fwk:libdhfwk_sdk",
91    "graphic_2d:2d_graphics",
92    "graphic_2d:libcomposer",
93    "graphic_2d:librender_service_base",
94    "graphic_2d:librender_service_client",
95    "graphic_surface:surface",
96    "hicollie:libhicollie",
97    "hilog:libhilog",
98    "hisysevent:libhisysevent",
99    "hitrace:hitrace_meter",
100    "ipc:ipc_core",
101    "json:nlohmann_json_static",
102    "libjpeg-turbo:turbojpeg",
103    "media_foundation:media_foundation",
104    "safwk:system_ability_fwk",
105    "samgr:samgr_proxy",
106    "window_manager:libdm",
107  ]
108
109  subsystem_name = "distributedhardware"
110
111  part_name = "distributed_screen"
112}
113