• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
129  public_external_deps = [
130    "ability_runtime:dataobs_manager",
131    "kv_store:distributeddata_inner",
132  ]
133
134  subsystem_name = "distributeddatamgr"
135  part_name = "data_share"
136}
137
138ohos_shared_library("datashare_permission") {
139  branch_protector_ret = "pac_ret"
140  sanitize = {
141    ubsan = true
142    boundary_sanitize = true
143    cfi = true
144    cfi_cross_dso = true
145    debug = false
146  }
147  include_dirs = []
148
149  sources = [
150    "${datashare_common_native_path}/src/datashare_string_utils.cpp",
151    "${datashare_native_permission_path}/src/data_share_called_config.cpp",
152    "${datashare_native_permission_path}/src/data_share_permission.cpp",
153  ]
154  configs = [ ":permission_config" ]
155  public_configs = [ ":permission_public_config" ]
156  version_script = "permission/libdatashare_permission.map"
157  innerapi_tags = [ "platformsdk" ]
158  deps = [ "${datashare_innerapi_path}/common:datashare_common" ]
159
160  external_deps = [
161    "ability_base:zuri",
162    "ability_runtime:app_context",
163    "ability_runtime:runtime",
164    "access_token:libaccesstoken_sdk",
165    "bundle_framework:appexecfwk_base",
166    "bundle_framework:appexecfwk_core",
167    "bundle_framework:libappexecfwk_common",
168    "c_utils:utils",
169    "common_event_service:cesfwk_innerkits",
170    "hilog:libhilog",
171    "ipc:ipc_single",
172    "samgr:samgr_proxy",
173  ]
174
175  subsystem_name = "distributeddatamgr"
176  part_name = "data_share"
177}
178
179ohos_shared_library("datashare_provider") {
180  branch_protector_ret = "pac_ret"
181  sanitize = {
182    ubsan = true
183    boundary_sanitize = true
184    cfi = true
185    cfi_cross_dso = true
186    debug = false
187  }
188  include_dirs = [ "${datashare_common_napi_path}/include" ]
189
190  sources = [
191    "${datashare_common_native_path}/src/datashare_string_utils.cpp",
192    "${datashare_native_provider_path}/src/datashare_ext_ability.cpp",
193    "${datashare_native_provider_path}/src/datashare_ext_ability_context.cpp",
194    "${datashare_native_provider_path}/src/datashare_stub.cpp",
195    "${datashare_native_provider_path}/src/datashare_stub_impl.cpp",
196    "${datashare_native_provider_path}/src/datashare_uv_queue.cpp",
197    "${datashare_native_provider_path}/src/js_datashare_ext_ability.cpp",
198    "${datashare_native_provider_path}/src/js_datashare_ext_ability_context.cpp",
199  ]
200  configs = [ ":ability_config" ]
201  public_configs = [ ":datashare_public_config" ]
202  version_script = "provider/libdatashare_provider.map"
203  innerapi_tags = [ "platformsdk" ]
204  deps = [
205    "${datashare_innerapi_path}/common:datashare_common",
206    "${datashare_napi_path}/dataShare:datashare_jscommon",
207  ]
208
209  external_deps = [
210    "ability_base:want",
211    "ability_base:zuri",
212    "ability_runtime:ability_context_native",
213    "ability_runtime:abilitykit_native",
214    "ability_runtime:app_context",
215    "ability_runtime:runtime",
216    "access_token:libaccesstoken_sdk",
217    "c_utils:utils",
218    "common_event_service:cesfwk_innerkits",
219    "hilog:libhilog",
220    "hisysevent:libhisysevent",
221    "ipc:ipc_napi",
222    "ipc:ipc_single",
223    "kv_store:distributeddata_inner",
224    "napi:ace_napi",
225    "samgr:samgr_proxy",
226  ]
227
228  public_external_deps = [ "ability_runtime:dataobs_manager" ]
229
230  subsystem_name = "distributeddatamgr"
231  part_name = "data_share"
232}
233
234ohos_shared_library("datashare_ext_ability_module") {
235  branch_protector_ret = "pac_ret"
236  sanitize = {
237    ubsan = true
238    boundary_sanitize = true
239    cfi = true
240    cfi_cross_dso = true
241    debug = false
242  }
243  include_dirs = [ "${datashare_native_provider_path}/include" ]
244
245  sources = [ "${datashare_native_provider_path}/src/datashare_ext_ability_module_loader.cpp" ]
246
247  configs = [ ":ability_config" ]
248  public_configs = [ ":datashare_public_config" ]
249
250  deps = [ ":datashare_provider" ]
251
252  external_deps = [
253    "ability_base:want",
254    "ability_runtime:abilitykit_native",
255    "ability_runtime:runtime",
256    "c_utils:utils",
257    "common_event_service:cesfwk_innerkits",
258    "hilog:libhilog",
259    "napi:ace_napi",
260  ]
261
262  relative_install_dir = "extensionability/"
263  subsystem_name = "distributeddatamgr"
264  part_name = "data_share"
265}
266
267ohos_static_library("datashare_consumer_static") {
268  branch_protector_ret = "pac_ret"
269  sanitize = {
270    ubsan = true
271    boundary_sanitize = true
272    cfi = true
273    cfi_cross_dso = true
274    debug = false
275  }
276  include_dirs = [ "${datashare_common_native_path}/include" ]
277
278  sources = datashare_consumer_sources
279  configs = [ ":ability_config" ]
280  public_configs = [ ":datashare_public_config" ]
281  deps = [ "${datashare_innerapi_path}/common:datashare_common_static" ]
282
283  external_deps = datashare_consumer_external_deps
284
285  public_external_deps = [ "kv_store:distributeddata_inner" ]
286
287  subsystem_name = "distributeddatamgr"
288  part_name = "data_share"
289}
290