• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2023 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/config/components/idl_tool/idl.gni")
15import("//build/ohos.gni")
16import("//foundation/distributeddatamgr/pasteboard/pasteboard.gni")
17
18idl_gen_interface("pasteboard_service_interface") {
19  sources = [
20    "IPasteboardClientDeathObserver.idl",
21    "IPasteboardService.idl",
22    "IPasteboardSignal.idl",
23  ]
24  sources_common = [ "PasteboardTypes.idl" ]
25  log_domainid = "0xD001C00"
26  log_tag = "PBIDL"
27}
28
29config("pasteboard_service_config") {
30  visibility = [ ":*" ]
31  visibility += [
32    "${pasteboard_root_path}/test/fuzztest/pasteboardobserver_fuzzer/*",
33    "${pasteboard_root_path}/test/fuzztest/pasteboardservice_fuzzer/*",
34  ]
35  include_dirs = [
36    "dfx/src",
37    "dfx/src/behaviour",
38    "dfx/src/statistic",
39    "dfx/src/fault",
40    "zidl/include",
41    "account/include",
42    "core/include",
43    "load/include",
44    "switch",
45    "../adapter/data_share",
46    "../adapter/security_level",
47    "${pasteboard_innerkits_path}/include",
48    "${pasteboard_utils_path}/mock/include",
49    "${pasteboard_utils_path}/native/include",
50    "${pasteboard_utils_path}/system/safwk/native/include",
51    "${pasteboard_framework_path}/include",
52    "${pasteboard_framework_path}/include/device",
53    "${pasteboard_tlv_path}",
54    "${target_gen_dir}",
55  ]
56  ldflags = [ "-Wl,--exclude-libs=ALL,--gc-sections" ]
57  cflags = [
58    "-fdata-sections",
59    "-ffunction-sections",
60    "-fvisibility=hidden",
61    "-O2",
62  ]
63}
64
65ohos_shared_library("pasteboard_service") {
66  branch_protector_ret = "pac_ret"
67  sanitize = {
68    integer_overflow = true
69    ubsan = true
70    boundary_sanitize = true
71    cfi = true
72    cfi_cross_dso = true
73    debug = false
74  }
75
76  version_script = "pasteboard_service_map"
77
78  sources = [
79    "${pasteboard_utils_path}/native/src/pasteboard_common.cpp",
80    "${pasteboard_utils_path}/native/src/pasteboard_time.cpp",
81    "../adapter/data_share/datashare_delegate.cpp",
82    "../adapter/security_level/security_level.cpp",
83    "account/src/account_manager.cpp",
84    "core/src/pasteboard_dialog.cpp",
85    "core/src/pasteboard_disposable_manager.cpp",
86    "core/src/pasteboard_lib_guard.cpp",
87    "core/src/pasteboard_pattern.cpp",
88    "core/src/pasteboard_service.cpp",
89    "dfx/src/behaviour/pasteboard_behaviour_reporter_impl.cpp",
90    "dfx/src/calculate_time_consuming.cpp",
91    "dfx/src/command.cpp",
92    "dfx/src/fault/pasteboard_fault_impl.cpp",
93    "dfx/src/hiview_adapter.cpp",
94    "dfx/src/pasteboard_dump_helper.cpp",
95    "dfx/src/pasteboard_event_dfx.cpp",
96    "dfx/src/pasteboard_trace.cpp",
97    "dfx/src/reporter.cpp",
98    "dfx/src/statistic/time_consuming_statistic_impl.cpp",
99    "load/src/config.cpp",
100    "load/src/loader.cpp",
101    "switch/pasteboard_switch.cpp",
102    "zidl/src/entity_recognition_observer_proxy.cpp",
103    "zidl/src/pasteboard_delay_getter_proxy.cpp",
104    "zidl/src/pasteboard_disposable_observer_proxy.cpp",
105    "zidl/src/pasteboard_entry_getter_proxy.cpp",
106    "zidl/src/pasteboard_observer_proxy.cpp",
107  ]
108
109  public_configs = [ ":pasteboard_service_config" ]
110  cflags_cc = [
111    "-fdata-sections",
112    "-ffunction-sections",
113    "-fno-asynchronous-unwind-tables",
114    "-fno-unwind-tables",
115    "-fomit-frame-pointer",
116    "-fvisibility=hidden",
117    "-D_FORTIFY_SOURCE=2",
118    "-O2",
119  ]
120
121  deps = [
122    ":pasteboard_service_idl",
123    "${pasteboard_framework_path}:pasteboard_framework",
124    "${pasteboard_innerkits_path}:pasteboard_data",
125  ]
126  defines = []
127
128  external_deps = [
129    "ability_base:base",
130    "ability_base:want",
131    "ability_base:zuri",
132    "ability_runtime:ability_manager",
133    "ability_runtime:uri_permission_mgr",
134    "ability_runtime:wantagent_innerkits",
135    "access_token:libaccesstoken_sdk",
136    "access_token:libprivacy_sdk",
137    "app_file_service:remote_file_share_native",
138    "bundle_framework:appexecfwk_base",
139    "bundle_framework:appexecfwk_core",
140    "c_utils:utils",
141    "common_event_service:cesfwk_innerkits",
142    "data_share:datashare_consumer",
143    "dataclassification:data_transit_mgr",
144    "device_manager:devicemanagersdk",
145    "dfs_service:distributed_file_daemon_kit_inner",
146    "eventhandler:libeventhandler",
147    "ffrt:libffrt",
148    "hilog:libhilog",
149    "hisysevent:libhisysevent",
150    "hitrace:hitrace_meter",
151    "imf:inputmethod_client",
152    "input:libmmi-client",
153    "ipc:ipc_single",
154    "libxml2:libxml2",
155    "memmgr:memmgrclient",
156    "os_account:os_account_innerkits",
157    "resource_schedule_service:ressched_client",
158    "safwk:system_ability_fwk",
159    "samgr:samgr_proxy",
160    "udmf:udmf_client",
161  ]
162  if (pasteboard_vixl_part_enabled) {
163    external_deps += [ "vixl:libvixl" ]
164    defines += [ "PB_VIXL_ENABLE" ]
165  }
166
167  if (window_manager_use_sceneboard) {
168    external_deps += [ "window_manager:libwm_lite" ]
169    defines += [ "SCENE_BOARD_ENABLE" ]
170  } else {
171    external_deps += [ "window_manager:libwm" ]
172  }
173  if (pasteboard_dlp_part_enabled) {
174    external_deps += [ "dlp_permission_service:libdlp_permission_sdk" ]
175    defines += [ "WITH_DLP" ]
176  }
177
178  if (pasteboard_device_info_manager_part_enabled) {
179    external_deps += [
180      "device_info_manager:distributed_device_profile_common",
181      "device_info_manager:distributed_device_profile_sdk",
182    ]
183    defines += [ "PB_DEVICE_INFO_MANAGER_ENABLE" ]
184  }
185
186  if (pasteboard_device_manager_part_enabled) {
187    external_deps += [ "device_manager:devicemanagersdk" ]
188    defines += [ "PB_DEVICE_MANAGER_ENABLE" ]
189  }
190
191  if (pasteboard_screenlock_mgr_part_enabled) {
192    external_deps += [ "screenlock_mgr:screenlock_client" ]
193    defines += [ "PB_SCREENLOCK_MGR_ENABLE" ]
194  }
195  subsystem_name = "distributeddatamgr"
196  part_name = "pasteboard"
197}
198
199ohos_source_set("pasteboard_stub_proxy") {
200  sanitize = {
201    ubsan = true
202    boundary_sanitize = true
203    cfi = true
204    cfi_cross_dso = true
205    debug = false
206  }
207  public_configs = [ ":pasteboard_service_config" ]
208  output_values = get_target_outputs(":pasteboard_service_interface")
209  sources = filter_include(output_values, [ "*.cpp" ])
210  sources += [ "zidl/src/pasteboard_observer_proxy.cpp" ]
211  deps = [ ":pasteboard_service_interface" ]
212  external_deps = [
213    "c_utils:utils",
214    "hilog:libhilog",
215    "ipc:ipc_single",
216    "samgr:samgr_proxy",
217    "udmf:udmf_client",
218  ]
219  subsystem_name = "distributeddatamgr"
220  part_name = "pasteboard"
221}
222
223ohos_source_set("pasteboard_client_idl") {
224  sanitize = {
225    ubsan = true
226    boundary_sanitize = true
227    cfi = true
228    cfi_cross_dso = true
229    debug = false
230  }
231
232  public_configs = [ ":pasteboard_service_config" ]
233  output_values = get_target_outputs(":pasteboard_service_interface")
234
235  sources = []
236  sources += filter_include(output_values, [ "*pasteboard_types.cpp" ])
237  sources += filter_include(output_values, [ "*pasteboard_service_proxy.cpp" ])
238  sources += filter_include(output_values, [ "*pasteboard_client_death_observer_stub.cpp" ])
239  sources += filter_include(output_values, [ "*pasteboard_signal_stub.cpp" ])
240
241  deps = [ ":pasteboard_service_interface" ]
242  external_deps = [
243    "c_utils:utils",
244    "hilog:libhilog",
245    "ipc:ipc_single",
246    "samgr:samgr_proxy",
247    "udmf:udmf_client",
248  ]
249
250  subsystem_name = "distributeddatamgr"
251  part_name = "pasteboard"
252}
253
254ohos_source_set("pasteboard_service_idl") {
255  sanitize = {
256    ubsan = true
257    boundary_sanitize = true
258    cfi = true
259    cfi_cross_dso = true
260    debug = false
261  }
262
263  public_configs = [ ":pasteboard_service_config" ]
264  output_values = get_target_outputs(":pasteboard_service_interface")
265
266  sources = []
267  sources += filter_include(output_values, [ "*pasteboard_types.cpp" ])
268  sources += filter_include(output_values, [ "*pasteboard_service_stub.cpp" ])
269  sources += filter_include(output_values, [ "*pasteboard_client_death_observer_proxy.cpp" ])
270  sources += filter_include(output_values, [ "*pasteboard_signal_proxy.cpp" ])
271
272  deps = [ ":pasteboard_service_interface" ]
273  external_deps = [
274    "c_utils:utils",
275    "hilog:libhilog",
276    "ipc:ipc_single",
277    "samgr:samgr_proxy",
278    "udmf:udmf_client",
279  ]
280
281  subsystem_name = "distributeddatamgr"
282  part_name = "pasteboard"
283}
284