# Copyright (C) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/distributeddatamgr/pasteboard/pasteboard.gni") config("pasteboard_service_config") { visibility = [ ":*" ] visibility += [ "${pasteboard_root_path}/test/fuzztest/pasteboardobserver_fuzzer/*", "${pasteboard_root_path}/test/fuzztest/pasteboardservice_fuzzer/*", ] include_dirs = [ "dfx/src", "dfx/src/behaviour", "dfx/src/statistic", "dfx/src/fault", "zidl/include", "account/include", "core/include", "load/include", "switch", "../adapter/data_share", "../adapter/security_level", "${pasteboard_innerkits_path}/include", "${pasteboard_utils_path}/mock/include", "${pasteboard_utils_path}/native/include", "${pasteboard_utils_path}/system/safwk/native/include", "${pasteboard_framework_path}/framework/include", "${pasteboard_framework_path}/framework/include/device", ] ldflags = [ "-Wl,--exclude-libs=ALL" ] cflags = [ "-fdata-sections", "-ffunction-sections", "-fvisibility=hidden", ] } ohos_shared_library("pasteboard_service") { branch_protector_ret = "pac_ret" sanitize = { ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false } sources = [ "../adapter/data_share/datashare_delegate.cpp", "../adapter/security_level/security_level.cpp", "account/src/account_manager.cpp", "core/src/pasteboard_dialog.cpp", "core/src/pasteboard_pattern.cpp", "core/src/pasteboard_service.cpp", "dfx/src/behaviour/pasteboard_behaviour_reporter_impl.cpp", "dfx/src/calculate_time_consuming.cpp", "dfx/src/command.cpp", "dfx/src/fault/pasteboard_fault_impl.cpp", "dfx/src/hiview_adapter.cpp", "dfx/src/pasteboard_dump_helper.cpp", "dfx/src/pasteboard_event_dfx.cpp", "dfx/src/pasteboard_trace.cpp", "dfx/src/reporter.cpp", "dfx/src/statistic/time_consuming_statistic_impl.cpp", "load/src/config.cpp", "load/src/loader.cpp", "switch/pasteboard_switch.cpp", "zidl/src/ipasteboard_client_death_observer.cpp", "zidl/src/pasteboard_delay_getter_proxy.cpp", "zidl/src/pasteboard_entry_getter_proxy.cpp", "zidl/src/pasteboard_observer_proxy.cpp", "zidl/src/pasteboard_service_stub.cpp", ] public_configs = [ ":pasteboard_service_config" ] public_external_deps = [ "c_utils:utils", "dfs_service:distributed_file_daemon_kit_inner", ] cflags_cc = [ "-fstack-protector", "-D_FORTIFY_SOURCE=2", "-O2", ] deps = [ "${pasteboard_framework_path}:pasteboard_framework", "${pasteboard_innerkits_path}:pasteboard_client", "${pasteboard_tlv_path}:pasteboard_tlv", "${pasteboard_uri_path}:pasteboard_uri", ] defines = [] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", "ability_runtime:uri_permission_mgr", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "app_file_service:remote_file_share_native", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "cJSON:cjson", "common_event_service:cesfwk_innerkits", "data_share:datashare_consumer", "dataclassification:data_transit_mgr", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "hitrace:libhitracechain", "image_framework:image_native", "init:libbeget_proxy", "init:libbegetutil", "input:libmmi-client", "ipc:ipc_core", "libxml2:libxml2", "memmgr:memmgrclient", "os_account:os_account_innerkits", "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", ] if (window_manager_use_sceneboard) { external_deps += [ "window_manager:libwm_lite" ] defines += [ "SCENE_BOARD_ENABLE" ] } else { external_deps += [ "window_manager:libwm" ] } if (pasteboard_dlp_part_enabled) { external_deps += [ "dlp_permission_service:libdlp_permission_sdk" ] defines += [ "WITH_DLP" ] } if (pasteboard_device_info_manager_part_enabled) { external_deps += [ "device_info_manager:distributed_device_profile_common", "device_info_manager:distributed_device_profile_sdk", ] defines += [ "PB_DEVICE_INFO_MANAGER_ENABLE" ] } if (pasteboard_device_manager_part_enabled) { external_deps += [ "device_manager:devicemanagersdk" ] defines += [ "PB_DEVICE_MANAGER_ENABLE" ] } if (pasteboard_screenlock_mgr_part_enabled) { external_deps += [ "screenlock_mgr:screenlock_client" ] defines += [ "PB_SCREENLOCK_MGR_ENABLE" ] } subsystem_name = "distributeddatamgr" part_name = "pasteboard" }