1bc03f14fSopenharmony_ci# Copyright (C) 2023 Huawei Device Co., Ltd.
2bc03f14fSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3bc03f14fSopenharmony_ci# you may not use this file except in compliance with the License.
4bc03f14fSopenharmony_ci# You may obtain a copy of the License at
5bc03f14fSopenharmony_ci#
6bc03f14fSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7bc03f14fSopenharmony_ci#
8bc03f14fSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9bc03f14fSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10bc03f14fSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11bc03f14fSopenharmony_ci# See the License for the specific language governing permissions and
12bc03f14fSopenharmony_ci# limitations under the License.
13bc03f14fSopenharmony_ci
14bc03f14fSopenharmony_ciimport("//build/ohos.gni")
15bc03f14fSopenharmony_ciimport("//foundation/distributeddatamgr/pasteboard/pasteboard.gni")
16bc03f14fSopenharmony_ci
17bc03f14fSopenharmony_ciconfig("pasteboard_service_config") {
18bc03f14fSopenharmony_ci  visibility = [ ":*" ]
19bc03f14fSopenharmony_ci  visibility += [
20bc03f14fSopenharmony_ci    "${pasteboard_root_path}/test/fuzztest/pasteboardobserver_fuzzer/*",
21bc03f14fSopenharmony_ci    "${pasteboard_root_path}/test/fuzztest/pasteboardservice_fuzzer/*",
22bc03f14fSopenharmony_ci  ]
23bc03f14fSopenharmony_ci  include_dirs = [
24bc03f14fSopenharmony_ci    "dfx/src",
25bc03f14fSopenharmony_ci    "dfx/src/behaviour",
26bc03f14fSopenharmony_ci    "dfx/src/statistic",
27bc03f14fSopenharmony_ci    "dfx/src/fault",
28bc03f14fSopenharmony_ci    "zidl/include",
29bc03f14fSopenharmony_ci    "account/include",
30bc03f14fSopenharmony_ci    "core/include",
31bc03f14fSopenharmony_ci    "load/include",
32bc03f14fSopenharmony_ci    "switch",
33bc03f14fSopenharmony_ci    "../adapter/data_share",
34bc03f14fSopenharmony_ci    "../adapter/security_level",
35bc03f14fSopenharmony_ci    "${pasteboard_innerkits_path}/include",
36bc03f14fSopenharmony_ci    "${pasteboard_utils_path}/mock/include",
37bc03f14fSopenharmony_ci    "${pasteboard_utils_path}/native/include",
38bc03f14fSopenharmony_ci    "${pasteboard_utils_path}/system/safwk/native/include",
39bc03f14fSopenharmony_ci    "${pasteboard_framework_path}/framework/include",
40bc03f14fSopenharmony_ci    "${pasteboard_framework_path}/framework/include/device",
41bc03f14fSopenharmony_ci  ]
42bc03f14fSopenharmony_ci  ldflags = [ "-Wl,--exclude-libs=ALL" ]
43bc03f14fSopenharmony_ci  cflags = [
44bc03f14fSopenharmony_ci    "-fdata-sections",
45bc03f14fSopenharmony_ci    "-ffunction-sections",
46bc03f14fSopenharmony_ci    "-fvisibility=hidden",
47bc03f14fSopenharmony_ci  ]
48bc03f14fSopenharmony_ci}
49bc03f14fSopenharmony_ci
50bc03f14fSopenharmony_ciohos_shared_library("pasteboard_service") {
51bc03f14fSopenharmony_ci  branch_protector_ret = "pac_ret"
52bc03f14fSopenharmony_ci  sanitize = {
53bc03f14fSopenharmony_ci    ubsan = true
54bc03f14fSopenharmony_ci    boundary_sanitize = true
55bc03f14fSopenharmony_ci    cfi = true
56bc03f14fSopenharmony_ci    cfi_cross_dso = true
57bc03f14fSopenharmony_ci    debug = false
58bc03f14fSopenharmony_ci  }
59bc03f14fSopenharmony_ci  sources = [
60bc03f14fSopenharmony_ci    "../adapter/data_share/datashare_delegate.cpp",
61bc03f14fSopenharmony_ci    "../adapter/security_level/security_level.cpp",
62bc03f14fSopenharmony_ci    "account/src/account_manager.cpp",
63bc03f14fSopenharmony_ci    "core/src/pasteboard_dialog.cpp",
64bc03f14fSopenharmony_ci    "core/src/pasteboard_pattern.cpp",
65bc03f14fSopenharmony_ci    "core/src/pasteboard_service.cpp",
66bc03f14fSopenharmony_ci    "dfx/src/behaviour/pasteboard_behaviour_reporter_impl.cpp",
67bc03f14fSopenharmony_ci    "dfx/src/calculate_time_consuming.cpp",
68bc03f14fSopenharmony_ci    "dfx/src/command.cpp",
69bc03f14fSopenharmony_ci    "dfx/src/fault/pasteboard_fault_impl.cpp",
70bc03f14fSopenharmony_ci    "dfx/src/hiview_adapter.cpp",
71bc03f14fSopenharmony_ci    "dfx/src/pasteboard_dump_helper.cpp",
72bc03f14fSopenharmony_ci    "dfx/src/pasteboard_event_dfx.cpp",
73bc03f14fSopenharmony_ci    "dfx/src/pasteboard_trace.cpp",
74bc03f14fSopenharmony_ci    "dfx/src/reporter.cpp",
75bc03f14fSopenharmony_ci    "dfx/src/statistic/time_consuming_statistic_impl.cpp",
76bc03f14fSopenharmony_ci    "load/src/config.cpp",
77bc03f14fSopenharmony_ci    "load/src/loader.cpp",
78bc03f14fSopenharmony_ci    "switch/pasteboard_switch.cpp",
79bc03f14fSopenharmony_ci    "zidl/src/ipasteboard_client_death_observer.cpp",
80bc03f14fSopenharmony_ci    "zidl/src/pasteboard_delay_getter_proxy.cpp",
81bc03f14fSopenharmony_ci    "zidl/src/pasteboard_entry_getter_proxy.cpp",
82bc03f14fSopenharmony_ci    "zidl/src/pasteboard_observer_proxy.cpp",
83bc03f14fSopenharmony_ci    "zidl/src/pasteboard_service_stub.cpp",
84bc03f14fSopenharmony_ci  ]
85bc03f14fSopenharmony_ci  public_configs = [ ":pasteboard_service_config" ]
86bc03f14fSopenharmony_ci  public_external_deps = [
87bc03f14fSopenharmony_ci    "c_utils:utils",
88bc03f14fSopenharmony_ci    "dfs_service:distributed_file_daemon_kit_inner",
89bc03f14fSopenharmony_ci  ]
90bc03f14fSopenharmony_ci  cflags_cc = [
91bc03f14fSopenharmony_ci    "-fstack-protector",
92bc03f14fSopenharmony_ci    "-D_FORTIFY_SOURCE=2",
93bc03f14fSopenharmony_ci    "-O2",
94bc03f14fSopenharmony_ci  ]
95bc03f14fSopenharmony_ci
96bc03f14fSopenharmony_ci  deps = [
97bc03f14fSopenharmony_ci    "${pasteboard_framework_path}:pasteboard_framework",
98bc03f14fSopenharmony_ci    "${pasteboard_innerkits_path}:pasteboard_client",
99bc03f14fSopenharmony_ci    "${pasteboard_tlv_path}:pasteboard_tlv",
100bc03f14fSopenharmony_ci    "${pasteboard_uri_path}:pasteboard_uri",
101bc03f14fSopenharmony_ci  ]
102bc03f14fSopenharmony_ci  defines = []
103bc03f14fSopenharmony_ci
104bc03f14fSopenharmony_ci  external_deps = [
105bc03f14fSopenharmony_ci    "ability_base:base",
106bc03f14fSopenharmony_ci    "ability_base:want",
107bc03f14fSopenharmony_ci    "ability_base:zuri",
108bc03f14fSopenharmony_ci    "ability_runtime:ability_manager",
109bc03f14fSopenharmony_ci    "ability_runtime:uri_permission_mgr",
110bc03f14fSopenharmony_ci    "ability_runtime:wantagent_innerkits",
111bc03f14fSopenharmony_ci    "access_token:libaccesstoken_sdk",
112bc03f14fSopenharmony_ci    "access_token:libprivacy_sdk",
113bc03f14fSopenharmony_ci    "access_token:libtokenid_sdk",
114bc03f14fSopenharmony_ci    "app_file_service:remote_file_share_native",
115bc03f14fSopenharmony_ci    "bundle_framework:appexecfwk_base",
116bc03f14fSopenharmony_ci    "bundle_framework:appexecfwk_core",
117bc03f14fSopenharmony_ci    "cJSON:cjson",
118bc03f14fSopenharmony_ci    "common_event_service:cesfwk_innerkits",
119bc03f14fSopenharmony_ci    "data_share:datashare_consumer",
120bc03f14fSopenharmony_ci    "dataclassification:data_transit_mgr",
121bc03f14fSopenharmony_ci    "eventhandler:libeventhandler",
122bc03f14fSopenharmony_ci    "ffrt:libffrt",
123bc03f14fSopenharmony_ci    "hilog:libhilog",
124bc03f14fSopenharmony_ci    "hisysevent:libhisysevent",
125bc03f14fSopenharmony_ci    "hitrace:hitrace_meter",
126bc03f14fSopenharmony_ci    "hitrace:libhitracechain",
127bc03f14fSopenharmony_ci    "image_framework:image_native",
128bc03f14fSopenharmony_ci    "init:libbeget_proxy",
129bc03f14fSopenharmony_ci    "init:libbegetutil",
130bc03f14fSopenharmony_ci    "input:libmmi-client",
131bc03f14fSopenharmony_ci    "ipc:ipc_core",
132bc03f14fSopenharmony_ci    "libxml2:libxml2",
133bc03f14fSopenharmony_ci    "memmgr:memmgrclient",
134bc03f14fSopenharmony_ci    "os_account:os_account_innerkits",
135bc03f14fSopenharmony_ci    "safwk:system_ability_fwk",
136bc03f14fSopenharmony_ci    "samgr:samgr_proxy",
137bc03f14fSopenharmony_ci    "time_service:time_client",
138bc03f14fSopenharmony_ci  ]
139bc03f14fSopenharmony_ci  if (window_manager_use_sceneboard) {
140bc03f14fSopenharmony_ci    external_deps += [ "window_manager:libwm_lite" ]
141bc03f14fSopenharmony_ci    defines += [ "SCENE_BOARD_ENABLE" ]
142bc03f14fSopenharmony_ci  } else {
143bc03f14fSopenharmony_ci    external_deps += [ "window_manager:libwm" ]
144bc03f14fSopenharmony_ci  }
145bc03f14fSopenharmony_ci  if (pasteboard_dlp_part_enabled) {
146bc03f14fSopenharmony_ci    external_deps += [ "dlp_permission_service:libdlp_permission_sdk" ]
147bc03f14fSopenharmony_ci    defines += [ "WITH_DLP" ]
148bc03f14fSopenharmony_ci  }
149bc03f14fSopenharmony_ci
150bc03f14fSopenharmony_ci  if (pasteboard_device_info_manager_part_enabled) {
151bc03f14fSopenharmony_ci    external_deps += [
152bc03f14fSopenharmony_ci      "device_info_manager:distributed_device_profile_common",
153bc03f14fSopenharmony_ci      "device_info_manager:distributed_device_profile_sdk",
154bc03f14fSopenharmony_ci    ]
155bc03f14fSopenharmony_ci    defines += [ "PB_DEVICE_INFO_MANAGER_ENABLE" ]
156bc03f14fSopenharmony_ci  }
157bc03f14fSopenharmony_ci
158bc03f14fSopenharmony_ci  if (pasteboard_device_manager_part_enabled) {
159bc03f14fSopenharmony_ci    external_deps += [ "device_manager:devicemanagersdk" ]
160bc03f14fSopenharmony_ci    defines += [ "PB_DEVICE_MANAGER_ENABLE" ]
161bc03f14fSopenharmony_ci  }
162bc03f14fSopenharmony_ci
163bc03f14fSopenharmony_ci  if (pasteboard_screenlock_mgr_part_enabled) {
164bc03f14fSopenharmony_ci    external_deps += [ "screenlock_mgr:screenlock_client" ]
165bc03f14fSopenharmony_ci    defines += [ "PB_SCREENLOCK_MGR_ENABLE" ]
166bc03f14fSopenharmony_ci  }
167bc03f14fSopenharmony_ci  subsystem_name = "distributeddatamgr"
168bc03f14fSopenharmony_ci  part_name = "pasteboard"
169bc03f14fSopenharmony_ci}
170