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_service_config") { 18 visibility = [ ":*" ] 19 visibility += [ 20 "${pasteboard_root_path}/test/fuzztest/pasteboardobserver_fuzzer/*", 21 "${pasteboard_root_path}/test/fuzztest/pasteboardservice_fuzzer/*", 22 ] 23 include_dirs = [ 24 "dfx/src", 25 "dfx/src/behaviour", 26 "dfx/src/statistic", 27 "dfx/src/fault", 28 "zidl/include", 29 "account/include", 30 "core/include", 31 "load/include", 32 "switch", 33 "../adapter/data_share", 34 "../adapter/security_level", 35 "${pasteboard_innerkits_path}/include", 36 "${pasteboard_utils_path}/mock/include", 37 "${pasteboard_utils_path}/native/include", 38 "${pasteboard_utils_path}/system/safwk/native/include", 39 "${pasteboard_framework_path}/framework/include", 40 "${pasteboard_framework_path}/framework/include/device", 41 ] 42 ldflags = [ "-Wl,--exclude-libs=ALL" ] 43 cflags = [ 44 "-fdata-sections", 45 "-ffunction-sections", 46 "-fvisibility=hidden", 47 "-O2", 48 ] 49} 50 51ohos_shared_library("pasteboard_service") { 52 branch_protector_ret = "pac_ret" 53 sanitize = { 54 integer_overflow = true 55 ubsan = true 56 boundary_sanitize = true 57 cfi = true 58 cfi_cross_dso = true 59 debug = false 60 } 61 sources = [ 62 "../adapter/data_share/datashare_delegate.cpp", 63 "../adapter/security_level/security_level.cpp", 64 "account/src/account_manager.cpp", 65 "core/src/pasteboard_dialog.cpp", 66 "core/src/pasteboard_pattern.cpp", 67 "core/src/pasteboard_service.cpp", 68 "dfx/src/behaviour/pasteboard_behaviour_reporter_impl.cpp", 69 "dfx/src/calculate_time_consuming.cpp", 70 "dfx/src/command.cpp", 71 "dfx/src/fault/pasteboard_fault_impl.cpp", 72 "dfx/src/hiview_adapter.cpp", 73 "dfx/src/pasteboard_dump_helper.cpp", 74 "dfx/src/pasteboard_event_dfx.cpp", 75 "dfx/src/pasteboard_trace.cpp", 76 "dfx/src/reporter.cpp", 77 "dfx/src/statistic/time_consuming_statistic_impl.cpp", 78 "load/src/config.cpp", 79 "load/src/loader.cpp", 80 "switch/pasteboard_switch.cpp", 81 "zidl/src/entity_recognition_observer_proxy.cpp", 82 "zidl/src/ipasteboard_client_death_observer.cpp", 83 "zidl/src/pasteboard_delay_getter_proxy.cpp", 84 "zidl/src/pasteboard_entry_getter_proxy.cpp", 85 "zidl/src/pasteboard_observer_proxy.cpp", 86 "zidl/src/pasteboard_service_stub.cpp", 87 ] 88 public_configs = [ ":pasteboard_service_config" ] 89 public_external_deps = [ 90 "c_utils:utils", 91 "dfs_service:distributed_file_daemon_kit_inner", 92 ] 93 cflags_cc = [ 94 "-fstack-protector", 95 "-D_FORTIFY_SOURCE=2", 96 "-O2", 97 ] 98 99 deps = [ 100 "${pasteboard_framework_path}:pasteboard_framework", 101 "${pasteboard_innerkits_path}:pasteboard_client", 102 "${pasteboard_tlv_path}:pasteboard_tlv", 103 ] 104 defines = [] 105 106 external_deps = [ 107 "ability_base:base", 108 "ability_base:want", 109 "ability_base:zuri", 110 "ability_runtime:ability_manager", 111 "ability_runtime:uri_permission_mgr", 112 "ability_runtime:wantagent_innerkits", 113 "access_token:libaccesstoken_sdk", 114 "access_token:libprivacy_sdk", 115 "access_token:libtokenid_sdk", 116 "app_file_service:remote_file_share_native", 117 "bundle_framework:appexecfwk_base", 118 "bundle_framework:appexecfwk_core", 119 "common_event_service:cesfwk_innerkits", 120 "data_share:datashare_consumer", 121 "dataclassification:data_transit_mgr", 122 "eventhandler:libeventhandler", 123 "ffrt:libffrt", 124 "hilog:libhilog", 125 "hisysevent:libhisysevent", 126 "hitrace:hitrace_meter", 127 "imf:inputmethod_client", 128 "input:libmmi-client", 129 "ipc:ipc_single", 130 "libxml2:libxml2", 131 "memmgr:memmgrclient", 132 "os_account:os_account_innerkits", 133 "resource_schedule_service:ressched_client", 134 "safwk:system_ability_fwk", 135 "samgr:samgr_proxy", 136 "time_service:time_client", 137 ] 138 if (pasteboard_vixl_part_enabled) { 139 external_deps += [ "vixl:libvixl" ] 140 defines += [ "PB_VIXL_ENABLE" ] 141 } 142 143 if (window_manager_use_sceneboard) { 144 external_deps += [ "window_manager:libwm_lite" ] 145 defines += [ "SCENE_BOARD_ENABLE" ] 146 } else { 147 external_deps += [ "window_manager:libwm" ] 148 } 149 if (pasteboard_dlp_part_enabled) { 150 external_deps += [ "dlp_permission_service:libdlp_permission_sdk" ] 151 defines += [ "WITH_DLP" ] 152 } 153 154 if (pasteboard_device_info_manager_part_enabled) { 155 external_deps += [ 156 "device_info_manager:distributed_device_profile_common", 157 "device_info_manager:distributed_device_profile_sdk", 158 ] 159 defines += [ "PB_DEVICE_INFO_MANAGER_ENABLE" ] 160 } 161 162 if (pasteboard_device_manager_part_enabled) { 163 external_deps += [ "device_manager:devicemanagersdk" ] 164 defines += [ "PB_DEVICE_MANAGER_ENABLE" ] 165 } 166 167 if (pasteboard_screenlock_mgr_part_enabled) { 168 external_deps += [ "screenlock_mgr:screenlock_client" ] 169 defines += [ "PB_SCREENLOCK_MGR_ENABLE" ] 170 } 171 subsystem_name = "distributeddatamgr" 172 use_exceptions = true 173 part_name = "pasteboard" 174} 175