1# Copyright (c) 2021-2024 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("//base/notification/distributed_notification_service/notification.gni") 15import("//build/ohos.gni") 16 17config("ans_distributed_config") { 18 include_dirs = [ "${services_path}/distributed/include" ] 19} 20 21ohos_shared_library("libans_distributed") { 22 sanitize = { 23 integer_overflow = true 24 ubsan = true 25 boundary_sanitize = true 26 cfi = true 27 cfi_cross_dso = true 28 debug = false 29 } 30 branch_protector_ret = "pac_ret" 31 32 sources = [ 33 "src/distributed_database.cpp", 34 "src/distributed_database_callback.cpp", 35 "src/distributed_device_callback.cpp", 36 "src/distributed_flow_control.cpp", 37 "src/distributed_notification_manager.cpp", 38 "src/distributed_preferences.cpp", 39 "src/distributed_preferences_database.cpp", 40 "src/distributed_preferences_info.cpp", 41 "src/distributed_screen_status_manager.cpp", 42 ] 43 44 include_dirs = [ "include" ] 45 46 defines = [] 47 48 configs = [ 49 ":ans_distributed_config", 50 "${frameworks_module_ans_path}:ans_innerkits_public_config", 51 ] 52 53 deps = [ "${frameworks_module_ans_path}:ans_innerkits" ] 54 55 external_deps = [ 56 "ability_base:want", 57 "ability_base:zuri", 58 "c_utils:utils", 59 "device_manager:devicemanagersdk", 60 "eventhandler:libeventhandler", 61 "ffrt:libffrt", 62 "hilog:libhilog", 63 "ipc:ipc_single", 64 "kv_store:distributeddata_inner", 65 ] 66 67 if (ans_hitrace_usage) { 68 external_deps += [ "hitrace:hitrace_meter" ] 69 defines += [ "HITRACE_METER_ENABLE" ] 70 } 71 72 subsystem_name = "${subsystem_name}" 73 part_name = "${component_name}" 74} 75 76ohos_shared_library("libdans") { 77 sanitize = { 78 integer_overflow = true 79 ubsan = true 80 boundary_sanitize = true 81 cfi = true 82 cfi_cross_dso = true 83 debug = false 84 } 85 branch_protector_ret = "pac_ret" 86 87 version_script = "libdans.map" 88 cflags = [ 89 "-fno-math-errno", 90 "-fno-unroll-loops", 91 "-fmerge-all-constants", 92 "-fno-ident", 93 "-Oz", 94 "-flto", 95 "-ffunction-sections", 96 "-fdata-sections", 97 ] 98 99 sources = [ 100 "src/base/distributed_client.cpp", 101 "src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp", 102 "src/base/distributed_local_config.cpp", 103 "src/base/distributed_send_adapter.cpp", 104 "src/base/distributed_server.cpp", 105 "src/base/distributed_socket.cpp", 106 "src/helper/ability_manager_helper.cpp", 107 "src/helper/analytics_util.cpp", 108 "src/helper/bundle_resource_helper.cpp", 109 "src/helper/distributed_operation_connection.cpp", 110 "src/helper/distributed_operation_helper.cpp", 111 "src/helper/distributed_preference.cpp", 112 "src/helper/distributed_rdb_helper.cpp", 113 "src/soft_bus/distributed_bundle_service.cpp", 114 "src/soft_bus/distributed_device_service.cpp", 115 "src/soft_bus/distributed_extern_intferface.cpp", 116 "src/soft_bus/distributed_observer_service.cpp", 117 "src/soft_bus/distributed_operation_service.cpp", 118 "src/soft_bus/distributed_publish_service_v2.cpp", 119 "src/soft_bus/distributed_service.cpp", 120 "src/soft_bus/distributed_subscribe_service_v2.cpp", 121 "src/soft_bus/distributed_subscriber.cpp", 122 "src/soft_bus/distributed_unlock_listener_oper_service.cpp", 123 "src/tlv_box/batch_remove_box.cpp", 124 "src/tlv_box/box_base.cpp", 125 "src/tlv_box/bundle_icon_box.cpp", 126 "src/tlv_box/match_box.cpp", 127 "src/tlv_box/notification_sync_box.cpp", 128 "src/tlv_box/remove_all_distributed_box.cpp", 129 "src/tlv_box/remove_box.cpp", 130 "src/tlv_box/request_box.cpp", 131 "src/tlv_box/response_box.cpp", 132 "src/tlv_box/state_box.cpp", 133 "src/tlv_box/tlv_box.cpp", 134 ] 135 136 include_dirs = [ 137 "${services_path}/distributed/include/base", 138 "${services_path}/distributed/include/helper", 139 "${services_path}/distributed/include/soft_bus", 140 "${services_path}/distributed/include/tlv_box", 141 "${services_path}/ans/include", 142 "${services_path}/distributed/include", 143 ] 144 145 deps = [ "${frameworks_module_ans_path}:ans_innerkits" ] 146 147 defines = [] 148 149 external_deps = [ 150 "ability_base:zuri", 151 "ability_runtime:ability_manager", 152 "ability_runtime:runtime", 153 "ability_runtime:uri_permission_mgr", 154 "bundle_framework:appexecfwk_base", 155 "bundle_framework:appexecfwk_core", 156 "c_utils:utils", 157 "device_manager:devicemanagersdk", 158 "dsoftbus:softbus_client", 159 "ffrt:libffrt", 160 "hilog:libhilog", 161 "ipc:ipc_core", 162 "kv_store:distributeddata_inner", 163 "os_account:os_account_innerkits", 164 "power_manager:powermgr_client", 165 "relational_store:native_rdb", 166 "samgr:samgr_proxy", 167 "time_service:time_client", 168 "zlib:libz", 169 ] 170 171 if (screenlock_mgr_enable) { 172 external_deps += [ "screenlock_mgr:screenlock_client" ] 173 defines += [ "SCREENLOCK_MGR_ENABLE" ] 174 } 175 176 if (ans_hitrace_usage) { 177 external_deps += [ "hitrace:hitrace_meter" ] 178 defines += [ "HITRACE_METER_ENABLE" ] 179 } 180 181 if (distributed_notification_service_feature_phone_collaboration) { 182 defines += [ "DISTRIBUTED_FEATURE_MASTER" ] 183 } 184 185 subsystem_name = "${subsystem_name}" 186 part_name = "${component_name}" 187} 188