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") 16import("//foundation/window/window_manager/windowmanager_aafwk.gni") 17 18config("pasteboard_service_config") { 19 visibility = [ ":*" ] 20 visibility += [ "//foundation/distributeddatamgr/pasteboard/test/fuzztest/pasteboardservice_fuzzer/*" ] 21 include_dirs = [ 22 "dfx/src", 23 "dfx/src/behaviour", 24 "dfx/src/statistic", 25 "dfx/src/fault", 26 "zidl/include", 27 "account/include", 28 "core/include", 29 "load/include", 30 "${filemanagement_service_path}/distributedfiledaemon/include/ipc", 31 "${pasteboard_innerkits_path}/include", 32 "${pasteboard_utils_path}/mock/include", 33 "${pasteboard_utils_path}/native/include", 34 "${pasteboard_utils_path}/system/safwk/native/include", 35 "${pasteboard_framework_path}/framework/include", 36 "${pasteboard_framework_path}/framework/include/device", 37 "//commonlibrary/c_utils/base/include", 38 ] 39 ldflags = [ "-Wl,--exclude-libs=ALL" ] 40 cflags = [ 41 "-fdata-sections", 42 "-ffunction-sections", 43 "-fvisibility=hidden", 44 ] 45} 46 47ohos_shared_library("pasteboard_service") { 48 sources = [ 49 "${pasteboard_innerkits_path}/src/paste_data.cpp", 50 "${pasteboard_innerkits_path}/src/paste_data_record.cpp", 51 "account/src/account_manager.cpp", 52 "core/src/pasteboard_dialog.cpp", 53 "core/src/pasteboard_service.cpp", 54 "dfx/src/behaviour/pasteboard_behaviour_reporter_impl.cpp", 55 "dfx/src/calculate_time_consuming.cpp", 56 "dfx/src/command.cpp", 57 "dfx/src/fault/pasteboard_fault_impl.cpp", 58 "dfx/src/hiview_adapter.cpp", 59 "dfx/src/pasteboard_dump_helper.cpp", 60 "dfx/src/pasteboard_trace.cpp", 61 "dfx/src/reporter.cpp", 62 "dfx/src/statistic/time_consuming_statistic_impl.cpp", 63 "load/src/config.cpp", 64 "load/src/loader.cpp", 65 "zidl/src/pasteboard_observer_proxy.cpp", 66 "zidl/src/pasteboard_service_stub.cpp", 67 ] 68 public_configs = [ 69 "//commonlibrary/c_utils/base:utils_config", 70 ":pasteboard_service_config", 71 ] 72 73 cflags_cc = [ 74 "-fstack-protector", 75 "-D_FORTIFY_SOURCE=2", 76 "-O2", 77 ] 78 79 deps = [ 80 "${pasteboard_framework_path}:pasteboard_framework", 81 "//foundation/distributeddatamgr/pasteboard/framework/framework:pasteboard_framework", 82 "//foundation/distributeddatamgr/pasteboard/framework/tlv:pasteboard_tlv", 83 "//foundation/distributeddatamgr/pasteboard/framework/uri:pasteboard_uri", 84 ] 85 defines = [] 86 87 configs = [ "//third_party/cJSON:cJSON_config" ] 88 89 deps += [ "//third_party/cJSON:cjson" ] 90 91 external_deps = [ 92 "ability_base:base", 93 "ability_base:want", 94 "ability_base:zuri", 95 "ability_runtime:ability_manager", 96 "ability_runtime:uri_permission_mgr", 97 "ability_runtime:wantagent_innerkits", 98 "access_token:libaccesstoken_sdk", 99 "app_file_service:remote_file_share_native", 100 "bundle_framework:appexecfwk_base", 101 "bundle_framework:appexecfwk_core", 102 "c_utils:utils", 103 "common_event_service:cesfwk_innerkits", 104 "dfs_service:distributed_file_daemon_kit_inner", 105 "eventhandler:libeventhandler", 106 "hilog:libhilog", 107 "hisysevent:libhisysevent", 108 "hitrace:hitrace_meter", 109 "hitrace:libhitracechain", 110 "image_framework:image_native", 111 "imf:inputmethod_client", 112 "init:libbeget_proxy", 113 "init:libbegetutil", 114 "input:libmmi-client", 115 "ipc:ipc_core", 116 "os_account:os_account_innerkits", 117 "safwk:system_ability_fwk", 118 "samgr:samgr_proxy", 119 "time_service:time_client", 120 "window_manager:libwm", 121 ] 122 if (scene_board_enabled) { 123 external_deps += [ "window_manager:libwm_lite" ] 124 defines += [ "SCENE_BOARD_ENABLE" ] 125 } else { 126 external_deps += [ "window_manager:libwm" ] 127 } 128 if (pb_dlp_part_enabled) { 129 external_deps += [ "dlp_permission_service:libdlp_permission_sdk" ] 130 defines += [ "WITH_DLP" ] 131 } 132 133 if (pb_device_info_manager_part_enabled) { 134 external_deps += [ "device_info_manager:distributed_device_profile_client" ] 135 defines += [ "PB_DEVICE_INFO_MANAGER_ENABLE" ] 136 } 137 138 if (pb_device_manager_part_enabled) { 139 external_deps += [ "device_manager:devicemanagersdk" ] 140 defines += [ "PB_DEVICE_MANAGER_ENABLE" ] 141 } 142 subsystem_name = "distributeddatamgr" 143 part_name = "pasteboard" 144} 145