• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023-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("//foundation/distributeddatamgr/pasteboard/pasteboard.gni")
16import("${pasteboard_tlv_path}/pasteboard_tlv.gni")
17
18config("pasteboard_client_config") {
19  visibility = [ ":*" ]
20  visibility += [ "//foundation/distributeddatamgr/pasteboard/test/fuzztest/pasteboardclient_fuzzer/*" ]
21  include_dirs = [
22    "include",
23    "${pasteboard_framework_path}/include",
24    "${pasteboard_root_path}/adapter/pasteboard_progress",
25    "${pasteboard_service_path}/core/include",
26    "${pasteboard_service_path}/dfx/src",
27    "${pasteboard_service_path}/zidl/include",
28    "${pasteboard_tlv_path}",
29    "${pasteboard_utils_path}/native/include",
30    "${root_out_dir}/gen/foundation/distributeddatamgr/pasteboard/services",
31  ]
32}
33
34config("pasteboard_data_config") {
35  visibility = [ ":*" ]
36  include_dirs = [
37    "include",
38    "${pasteboard_framework_path}/include",
39    "${pasteboard_service_path}/core/include",
40    "${pasteboard_service_path}/dfx/src",
41    "${pasteboard_service_path}/zidl/include",
42    "${pasteboard_tlv_path}",
43    "${pasteboard_utils_path}/native/include",
44    "${root_out_dir}/gen/foundation/distributeddatamgr/pasteboard/services",
45  ]
46}
47
48ohos_shared_library("pasteboard_data") {
49  branch_protector_ret = "pac_ret"
50  sanitize = {
51    integer_overflow = true
52    ubsan = true
53    boundary_sanitize = true
54    cfi = true
55    cfi_cross_dso = true
56    debug = false
57  }
58
59  version_script = "pasteboard_kit_map"
60
61  sources = [
62    "${pasteboard_utils_path}/native/src/pasteboard_common.cpp",
63    "src/convert_utils.cpp",
64    "src/paste_data.cpp",
65    "src/paste_data_entry.cpp",
66    "src/paste_data_record.cpp",
67    "src/pasteboard_load_callback.cpp",
68    "src/pasteboard_service_loader.cpp",
69    "src/pasteboard_web_controller.cpp",
70  ]
71  sources += pasteboard_tlv_sources
72
73  ldflags = [ "-Wl,--gc-sections" ]
74  cflags = [
75    "-fdata-sections",
76    "-ffunction-sections",
77    "-fvisibility=hidden",
78    "-O2",
79  ]
80  cflags_cc = [
81    "-fdata-sections",
82    "-ffunction-sections",
83    "-fno-asynchronous-unwind-tables",
84    "-fno-unwind-tables",
85    "-fomit-frame-pointer",
86    "-fvisibility=hidden",
87    "-D_FORTIFY_SOURCE=2",
88    "-O2",
89  ]
90
91  public_configs = [ ":pasteboard_data_config" ]
92  deps = [ "${pasteboard_service_path}:pasteboard_client_idl" ]
93
94  external_deps = [
95    "ability_base:zuri",
96    "ability_runtime:ability_manager",
97    "ability_runtime:uri_permission_mgr",
98    "access_token:libtokenid_sdk",
99    "app_file_service:fileuri_native",
100    "bundle_framework:appexecfwk_base",
101    "bundle_framework:appexecfwk_core",
102    "c_utils:utils",
103    "hilog:libhilog",
104    "image_framework:image_native",
105    "ipc:ipc_single",
106    "samgr:samgr_proxy",
107    "udmf:udmf_client",
108  ]
109  subsystem_name = "distributeddatamgr"
110  innerapi_tags = [ "platformsdk" ]
111  part_name = "pasteboard"
112}
113
114ohos_shared_library("pasteboard_client") {
115  branch_protector_ret = "pac_ret"
116  sanitize = {
117    integer_overflow = true
118    ubsan = true
119    boundary_sanitize = true
120    cfi = true
121    cfi_cross_dso = true
122    debug = false
123  }
124
125  version_script = "pasteboard_kit_map"
126  sources = [
127    "${pasteboard_root_path}/adapter/pasteboard_progress/pasteboard_progress.cpp",
128    "${pasteboard_service_path}/dfx/src/hiview_adapter.cpp",
129    "${pasteboard_service_path}/zidl/src/entity_recognition_observer_stub.cpp",
130    "${pasteboard_service_path}/zidl/src/pasteboard_delay_getter_client.cpp",
131    "${pasteboard_service_path}/zidl/src/pasteboard_delay_getter_stub.cpp",
132    "${pasteboard_service_path}/zidl/src/pasteboard_disposable_observer_stub.cpp",
133    "${pasteboard_service_path}/zidl/src/pasteboard_entry_getter_client.cpp",
134    "${pasteboard_service_path}/zidl/src/pasteboard_entry_getter_stub.cpp",
135    "${pasteboard_service_path}/zidl/src/pasteboard_observer_stub.cpp",
136    "${pasteboard_utils_path}/native/src/pasteboard_time.cpp",
137    "src/entity_recognition_observer.cpp",
138    "src/i_paste_data_processor.cpp",
139    "src/pasteboard_client.cpp",
140    "src/pasteboard_copy.cpp",
141    "src/pasteboard_disposable_observer.cpp",
142    "src/pasteboard_entry_getter.cpp",
143    "src/pasteboard_observer.cpp",
144    "src/pasteboard_progress_signal.cpp",
145    "src/pasteboard_samgr_listener.cpp",
146    "src/pasteboard_signal_callback.cpp",
147    "src/pasteboard_utils.cpp",
148  ]
149
150  cflags_cc = [
151    "-D_FORTIFY_SOURCE=2",
152    "-O2",
153    "-fvisibility=hidden",
154  ]
155
156  public_configs = [ ":pasteboard_client_config" ]
157  deps = [
158    "${pasteboard_framework_path}:pasteboard_framework",
159    "${pasteboard_innerkits_path}:pasteboard_data",
160    "${pasteboard_service_path}:pasteboard_client_idl",
161  ]
162
163  external_deps = [
164    "ability_base:zuri",
165    "ability_runtime:ability_manager",
166    "ability_runtime:uri_permission_mgr",
167    "ability_runtime:wantagent_innerkits",
168    "access_token:libtokenid_sdk",
169    "app_file_service:fileuri_native",
170    "bundle_framework:appexecfwk_base",
171    "bundle_framework:appexecfwk_core",
172    "c_utils:utils",
173    "data_share:datashare_common",
174    "data_share:datashare_consumer",
175    "device_manager:devicemanagersdk",
176    "dfs_service:distributed_file_daemon_kit_inner",
177    "ffrt:libffrt",
178    "hilog:libhilog",
179    "hisysevent:libhisysevent",
180    "hitrace:hitrace_meter",
181    "image_framework:image_native",
182    "ipc:ipc_single",
183    "libuv:uv",
184    "libxml2:libxml2",
185    "samgr:samgr_proxy",
186    "udmf:udmf_client",
187  ]
188  public_external_deps = [ "udmf:udmf_client" ]
189  subsystem_name = "distributeddatamgr"
190  innerapi_tags = [ "platformsdk" ]
191  part_name = "pasteboard"
192}
193