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/ohos.gni")
15import("//foundation/distributeddatamgr/pasteboard/pasteboard.gni")
16
17config("pasteboard_client_config") {
18  visibility = [ ":*" ]
19  visibility += [ "//foundation/distributeddatamgr/pasteboard/test/fuzztest/pasteboardclient_fuzzer/*" ]
20  include_dirs = [
21    "include",
22    "${pasteboard_service_path}/core/include",
23    "${pasteboard_service_path}/dfx/src",
24    "${pasteboard_service_path}/zidl/include",
25    "${pasteboard_utils_path}/native/include",
26    "//foundation/distributeddatamgr/pasteboard/framework/framework/include",
27    "//foundation/distributeddatamgr/pasteboard/framework/tlv",
28    "//foundation/distributeddatamgr/pasteboard/framework/uri",
29  ]
30}
31
32ohos_shared_library("pasteboard_client") {
33  branch_protector_ret = "pac_ret"
34  sanitize = {
35    ubsan = true
36    boundary_sanitize = true
37    cfi = true
38    cfi_cross_dso = true
39    debug = false
40  }
41  sources = [
42    "${pasteboard_service_path}/core/src/pasteboard_pattern.cpp",
43    "${pasteboard_service_path}/dfx/src/hiview_adapter.cpp",
44    "${pasteboard_service_path}/zidl/src/ipasteboard_client_death_observer.cpp",
45    "${pasteboard_service_path}/zidl/src/pasteboard_delay_getter_client.cpp",
46    "${pasteboard_service_path}/zidl/src/pasteboard_delay_getter_stub.cpp",
47    "${pasteboard_service_path}/zidl/src/pasteboard_entry_getter_client.cpp",
48    "${pasteboard_service_path}/zidl/src/pasteboard_entry_getter_stub.cpp",
49    "${pasteboard_service_path}/zidl/src/pasteboard_observer_stub.cpp",
50    "${pasteboard_service_path}/zidl/src/pasteboard_service_proxy.cpp",
51    "src/convert_utils.cpp",
52    "src/paste_data.cpp",
53    "src/paste_data_entry.cpp",
54    "src/paste_data_record.cpp",
55    "src/pasteboard_client.cpp",
56    "src/pasteboard_entry_getter.cpp",
57    "src/pasteboard_load_callback.cpp",
58    "src/pasteboard_observer.cpp",
59    "src/pasteboard_utils.cpp",
60    "src/pasteboard_web_controller.cpp",
61  ]
62
63  cflags_cc = [
64    "-fstack-protector",
65    "-D_FORTIFY_SOURCE=2",
66    "-O2",
67    "-fvisibility=hidden",
68  ]
69
70  public_configs = [ ":pasteboard_client_config" ]
71  deps = [
72    "${pasteboard_root_path}/framework/tlv:pasteboard_tlv",
73    "${pasteboard_root_path}/framework/uri:pasteboard_uri",
74  ]
75
76  external_deps = [
77    "ability_base:want",
78    "ability_base:zuri",
79    "ability_runtime:wantagent_innerkits",
80    "app_file_service:fileuri_native",
81    "hilog:libhilog",
82    "hisysevent:libhisysevent",
83    "hitrace:hitrace_meter",
84    "image_framework:image_native",
85    "ipc:ipc_core",
86    "samgr:samgr_proxy",
87    "time_service:time_client",
88  ]
89  public_external_deps = [
90    "c_utils:utils",
91    "udmf:udmf_client",
92  ]
93  subsystem_name = "distributeddatamgr"
94  innerapi_tags = [ "platformsdk" ]
95  part_name = "pasteboard"
96}
97