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
17ohos_shared_library("datashare_jscommon") {
18  branch_protector_ret = "pac_ret"
19  sanitize = {
20    ubsan = true
21    boundary_sanitize = true
22    cfi = true
23    cfi_cross_dso = true
24    debug = false
25  }
26  include_dirs = [
27    "${datashare_common_native_path}/include",
28    "${datashare_common_napi_path}/include",
29  ]
30
31  sources = [
32    "${datashare_common_napi_path}/src/datashare_js_utils.cpp",
33    "${datashare_common_napi_path}/src/datashare_predicates_proxy.cpp",
34    "${datashare_common_napi_path}/src/napi_datashare_values_bucket.cpp",
35  ]
36
37  deps = [ "${datashare_innerapi_path}/common:datashare_common" ]
38
39  version_script = "libdatashare_jscommon.map"
40
41  external_deps = [
42    "ability_base:zuri",
43    "c_utils:utils",
44    "hilog:libhilog",
45    "hisysevent:libhisysevent",
46    "hitrace:hitrace_meter",
47    "hitrace:libhitracechain",
48    "ipc:ipc_napi",
49    "ipc:ipc_single",
50    "kv_store:distributeddata_inner",
51    "napi:ace_napi",
52  ]
53
54  subsystem_name = "distributeddatamgr"
55  part_name = "data_share"
56}
57
58ohos_shared_library("datashare") {
59  branch_protector_ret = "pac_ret"
60  sanitize = {
61    ubsan = true
62    boundary_sanitize = true
63    cfi = true
64    cfi_cross_dso = true
65    debug = false
66  }
67  include_dirs = [
68    "${datashare_napi_path}/dataShare/include",
69    "${datashare_common_napi_path}/include",
70    "${datashare_common_native_path}/include",
71    "${datashare_napi_path}/observer/include",
72  ]
73
74  sources = [
75    "${datashare_common_napi_path}/src/datashare_error_impl.cpp",
76    "${datashare_common_napi_path}/src/datashare_result_set_proxy.cpp",
77    "${datashare_napi_path}/dataShare/src/async_call.cpp",
78    "${datashare_napi_path}/dataShare/src/napi_datashare_const_properties.cpp",
79    "${datashare_napi_path}/dataShare/src/napi_datashare_helper.cpp",
80    "${datashare_napi_path}/dataShare/src/napi_datashare_inner_observer.cpp",
81    "${datashare_napi_path}/dataShare/src/napi_datashare_observer.cpp",
82    "${datashare_napi_path}/dataShare/src/native_datashare_module.cpp",
83    "${datashare_napi_path}/observer/src/napi_observer.cpp",
84    "${datashare_napi_path}/observer/src/napi_subscriber_manager.cpp",
85  ]
86
87  deps = [
88    ":datashare_jscommon",
89    "${datashare_innerapi_path}:datashare_consumer",
90    "${datashare_innerapi_path}/common:datashare_common",
91  ]
92
93  external_deps = [
94    "ability_base:base",
95    "ability_base:want",
96    "ability_base:zuri",
97    "ability_runtime:abilitykit_native",
98    "ability_runtime:dataobs_manager",
99    "ability_runtime:napi_base_context",
100    "ability_runtime:napi_common",
101    "c_utils:utils",
102    "common_event_service:cesfwk_innerkits",
103    "hilog:libhilog",
104    "hitrace:hitrace_meter",
105    "hitrace:libhitracechain",
106    "ipc:ipc_single",
107    "kv_store:distributeddata_inner",
108    "libuv:uv",
109    "napi:ace_napi",
110  ]
111
112  relative_install_dir = "module/data"
113
114  subsystem_name = "distributeddatamgr"
115  part_name = "data_share"
116}
117
118ohos_shared_library("datasharepredicates") {
119  branch_protector_ret = "pac_ret"
120  sanitize = {
121    ubsan = true
122    boundary_sanitize = true
123    cfi = true
124    cfi_cross_dso = true
125    debug = false
126  }
127  include_dirs = [
128    "${datashare_common_napi_path}/include",
129    "${datashare_common_native_path}/include",
130  ]
131
132  sources = [ "${datashare_napi_path}/dataShare/src/native_datashare_predicates_module.cpp" ]
133
134  deps = [
135    ":datashare_jscommon",
136    "${datashare_innerapi_path}:datashare_consumer",
137    "${datashare_innerapi_path}/common:datashare_common",
138  ]
139
140  external_deps = [
141    "c_utils:utils",
142    "hilog:libhilog",
143    "ipc:ipc_single",
144    "kv_store:distributeddata_inner",
145    "napi:ace_napi",
146  ]
147
148  relative_install_dir = "module/data"
149
150  subsystem_name = "distributeddatamgr"
151  part_name = "data_share"
152}
153