1# Copyright (c) 2022 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/data_share/datashare.gni") 16 17config("ability_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "common/include", 21 "consumer/include", 22 "provider/include", 23 "${datashare_native_consumer_path}/include", 24 "${datashare_native_provider_path}/include", 25 "${datashare_native_proxy_path}/include", 26 ] 27 28 cflags = [] 29 if (target_cpu == "arm") { 30 cflags += [ "-DBINDER_IPC_32BIT" ] 31 } 32} 33 34config("datashare_public_config") { 35 visibility = [ ":*" ] 36 include_dirs = [ 37 "common/include", 38 "consumer/include", 39 "provider/include", 40 "${datashare_common_native_path}/include", 41 "${datashare_native_consumer_path}/controller/common", 42 "${datashare_native_consumer_path}/controller/provider/include", 43 "${datashare_native_consumer_path}/controller/service/include", 44 "${datashare_native_consumer_path}/include", 45 "${datashare_native_provider_path}/include", 46 "${datashare_native_proxy_path}/include", 47 ] 48} 49 50datashare_consumer_sources = [ 51 "${datashare_common_native_path}/src/call_reporter.cpp", 52 "${datashare_common_native_path}/src/datashare_string_utils.cpp", 53 "${datashare_common_native_path}/src/datashare_uri_utils.cpp", 54 "${datashare_native_consumer_path}/controller/provider/src/ext_special_controller.cpp", 55 "${datashare_native_consumer_path}/controller/provider/src/general_controller_provider_impl.cpp", 56 "${datashare_native_consumer_path}/controller/service/src/general_controller_service_impl.cpp", 57 "${datashare_native_consumer_path}/controller/service/src/persistent_data_controller.cpp", 58 "${datashare_native_consumer_path}/controller/service/src/published_data_controller.cpp", 59 "${datashare_native_consumer_path}/src/datashare_connection.cpp", 60 "${datashare_native_consumer_path}/src/datashare_helper.cpp", 61 "${datashare_native_consumer_path}/src/datashare_helper_impl.cpp", 62 "${datashare_native_consumer_path}/src/datashare_proxy.cpp", 63 "${datashare_native_proxy_path}/src/ams_mgr_proxy.cpp", 64 "${datashare_native_proxy_path}/src/data_proxy_observer_stub.cpp", 65 "${datashare_native_proxy_path}/src/data_share_manager_impl.cpp", 66 "${datashare_native_proxy_path}/src/data_share_service_proxy.cpp", 67 "${datashare_native_proxy_path}/src/idata_share_client_death_observer.cpp", 68 "${datashare_native_proxy_path}/src/published_data_subscriber_manager.cpp", 69 "${datashare_native_proxy_path}/src/rdb_subscriber_manager.cpp", 70] 71 72datashare_consumer_external_deps = [ 73 "ability_base:want", 74 "ability_base:zuri", 75 "ability_runtime:app_context", 76 "ability_runtime:extension_manager", 77 "c_utils:utils", 78 "common_event_service:cesfwk_innerkits", 79 "hilog:libhilog", 80 "hisysevent:libhisysevent", 81 "hitrace:hitrace_meter", 82 "hitrace:libhitracechain", 83 "ipc:ipc_single", 84 "ipc:rpc", 85 "samgr:samgr_proxy", 86] 87 88config("permission_config") { 89 visibility = [ ":*" ] 90 include_dirs = [ 91 "common/include", 92 "permission/include", 93 "${datashare_common_native_path}/include", 94 "${datashare_native_permission_path}/include", 95 ] 96} 97 98config("permission_public_config") { 99 visibility = [ ":*" ] 100 include_dirs = [ 101 "common/include", 102 "permission/include", 103 ] 104} 105 106ohos_shared_library("datashare_consumer") { 107 branch_protector_ret = "pac_ret" 108 sanitize = { 109 ubsan = true 110 boundary_sanitize = true 111 cfi = true 112 cfi_cross_dso = true 113 debug = false 114 } 115 include_dirs = [ "${datashare_common_native_path}/include" ] 116 117 sources = datashare_consumer_sources 118 configs = [ ":ability_config" ] 119 public_configs = [ ":datashare_public_config" ] 120 version_script = "consumer/libdatashare_consumer.map" 121 innerapi_tags = [ 122 "platformsdk", 123 "sasdk", 124 ] 125 deps = [ "${datashare_innerapi_path}/common:datashare_common" ] 126 127 external_deps = datashare_consumer_external_deps 128 external_deps += [ "ability_runtime:ability_connect_callback_stub" ] 129 130 public_external_deps = [ 131 "ability_runtime:dataobs_manager", 132 "kv_store:distributeddata_inner", 133 ] 134 135 subsystem_name = "distributeddatamgr" 136 part_name = "data_share" 137} 138 139ohos_shared_library("datashare_permission") { 140 branch_protector_ret = "pac_ret" 141 sanitize = { 142 ubsan = true 143 boundary_sanitize = true 144 cfi = true 145 cfi_cross_dso = true 146 debug = false 147 } 148 include_dirs = [] 149 150 sources = [ 151 "${datashare_common_native_path}/src/datashare_string_utils.cpp", 152 "${datashare_native_permission_path}/src/data_share_called_config.cpp", 153 "${datashare_native_permission_path}/src/data_share_permission.cpp", 154 ] 155 configs = [ ":permission_config" ] 156 public_configs = [ ":permission_public_config" ] 157 version_script = "permission/libdatashare_permission.map" 158 innerapi_tags = [ "platformsdk" ] 159 deps = [ "${datashare_innerapi_path}/common:datashare_common" ] 160 161 external_deps = [ 162 "ability_base:zuri", 163 "ability_runtime:app_context", 164 "ability_runtime:runtime", 165 "access_token:libaccesstoken_sdk", 166 "bundle_framework:appexecfwk_base", 167 "bundle_framework:appexecfwk_core", 168 "bundle_framework:libappexecfwk_common", 169 "c_utils:utils", 170 "common_event_service:cesfwk_innerkits", 171 "hilog:libhilog", 172 "ipc:ipc_single", 173 "samgr:samgr_proxy", 174 ] 175 176 subsystem_name = "distributeddatamgr" 177 part_name = "data_share" 178} 179 180ohos_shared_library("datashare_provider") { 181 branch_protector_ret = "pac_ret" 182 sanitize = { 183 ubsan = true 184 boundary_sanitize = true 185 cfi = true 186 cfi_cross_dso = true 187 debug = false 188 } 189 include_dirs = [ "${datashare_common_napi_path}/include" ] 190 191 sources = [ 192 "${datashare_common_native_path}/src/datashare_string_utils.cpp", 193 "${datashare_native_provider_path}/src/datashare_ext_ability.cpp", 194 "${datashare_native_provider_path}/src/datashare_ext_ability_context.cpp", 195 "${datashare_native_provider_path}/src/datashare_stub.cpp", 196 "${datashare_native_provider_path}/src/datashare_stub_impl.cpp", 197 "${datashare_native_provider_path}/src/datashare_uv_queue.cpp", 198 "${datashare_native_provider_path}/src/js_datashare_ext_ability.cpp", 199 "${datashare_native_provider_path}/src/js_datashare_ext_ability_context.cpp", 200 ] 201 configs = [ ":ability_config" ] 202 public_configs = [ ":datashare_public_config" ] 203 version_script = "provider/libdatashare_provider.map" 204 innerapi_tags = [ "platformsdk" ] 205 deps = [ 206 "${datashare_innerapi_path}/common:datashare_common", 207 "${datashare_napi_path}/dataShare:datashare_jscommon", 208 ] 209 210 external_deps = [ 211 "ability_base:want", 212 "ability_base:zuri", 213 "ability_runtime:ability_connect_callback_stub", 214 "ability_runtime:ability_context_native", 215 "ability_runtime:abilitykit_native", 216 "ability_runtime:app_context", 217 "ability_runtime:extensionkit_native", 218 "ability_runtime:napi_common", 219 "ability_runtime:runtime", 220 "access_token:libaccesstoken_sdk", 221 "c_utils:utils", 222 "common_event_service:cesfwk_innerkits", 223 "hilog:libhilog", 224 "hisysevent:libhisysevent", 225 "ipc:ipc_napi", 226 "ipc:ipc_single", 227 "kv_store:distributeddata_inner", 228 "napi:ace_napi", 229 "samgr:samgr_proxy", 230 ] 231 232 public_external_deps = [ "ability_runtime:dataobs_manager" ] 233 234 subsystem_name = "distributeddatamgr" 235 part_name = "data_share" 236} 237 238ohos_shared_library("datashare_ext_ability_module") { 239 branch_protector_ret = "pac_ret" 240 sanitize = { 241 ubsan = true 242 boundary_sanitize = true 243 cfi = true 244 cfi_cross_dso = true 245 debug = false 246 } 247 include_dirs = [ "${datashare_native_provider_path}/include" ] 248 249 sources = [ "${datashare_native_provider_path}/src/datashare_ext_ability_module_loader.cpp" ] 250 251 configs = [ ":ability_config" ] 252 public_configs = [ ":datashare_public_config" ] 253 254 deps = [ ":datashare_provider" ] 255 256 external_deps = [ 257 "ability_base:want", 258 "ability_runtime:abilitykit_native", 259 "ability_runtime:runtime", 260 "c_utils:utils", 261 "common_event_service:cesfwk_innerkits", 262 "hilog:libhilog", 263 "ipc:ipc_napi", 264 "ipc:ipc_single", 265 "napi:ace_napi", 266 ] 267 268 relative_install_dir = "extensionability/" 269 subsystem_name = "distributeddatamgr" 270 part_name = "data_share" 271} 272 273ohos_static_library("datashare_consumer_static") { 274 branch_protector_ret = "pac_ret" 275 sanitize = { 276 ubsan = true 277 boundary_sanitize = true 278 cfi = true 279 cfi_cross_dso = true 280 debug = false 281 } 282 include_dirs = [ "${datashare_common_native_path}/include" ] 283 284 sources = datashare_consumer_sources 285 configs = [ ":ability_config" ] 286 public_configs = [ ":datashare_public_config" ] 287 deps = [ "${datashare_innerapi_path}/common:datashare_common_static" ] 288 289 external_deps = datashare_consumer_external_deps 290 291 public_external_deps = [ "kv_store:distributeddata_inner" ] 292 293 subsystem_name = "distributeddatamgr" 294 part_name = "data_share" 295} 296