• 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("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni")
15import("//build/ohos.gni")
16import("//build/ohos/ace/ace.gni")
17import("//foundation/arkui/ace_engine/ace_config.gni")
18import("//foundation/distributeddatamgr/data_object/data_object.gni")
19group("build_module") {
20  deps = [ ":distributeddataobject" ]
21}
22
23# compile .js to .abc.
24es2abc_gen_abc("gen_distributed_data_object_abc") {
25  extra_visibility = [ ":*" ]
26  src_js = rebase_path("distributed_data_object.js")
27  dst_file = rebase_path(target_out_dir + "/distributed_data_object.abc")
28  in_puts = [ "distributed_data_object.js" ]
29  out_puts = [ target_out_dir + "/distributed_data_object.abc" ]
30  extra_args = [ "--module" ]
31}
32
33config("objectstore_config") {
34  visibility = [ ":*" ]
35
36  cflags = [ "-DHILOG_ENABLE" ]
37
38  include_dirs = [
39    "../../frameworks/jskitsimpl/include/adaptor",
40    "../../frameworks/jskitsimpl/include/common",
41    "../../frameworks/innerkitsimpl/include/adaptor",
42    "../../frameworks/innerkitsimpl/include/common",
43    "../../frameworks/innerkitsimpl/include",
44    "../../frameworks/innerkitsimpl/include/communicator",
45    "../../interfaces/innerkits",
46    "${kvstore_path}/common",
47    "${relational_store_path}/interfaces/inner_api/common_type/include",
48  ]
49}
50
51config("objectstore_public_config") {
52  visibility = [ ":*" ]
53
54  include_dirs = [ "." ]
55}
56
57base_output_path =
58    get_label_info(":distributed_data_object_js", "target_out_dir")
59distributed_data_object_js_obj_path =
60    base_output_path + "/distributed_data_object.o"
61gen_js_obj("distributed_data_object_js") {
62  input = "distributed_data_object.js"
63  output = distributed_data_object_js_obj_path
64  dep = ":gen_distributed_data_object_abc"
65}
66
67abc_output_path =
68    get_label_info(":distributed_data_object_abc", "target_out_dir")
69distributed_data_object_abc_obj_path =
70    abc_output_path + "/distributed_data_object_abc.o"
71gen_js_obj("distributed_data_object_abc") {
72  input = "$target_out_dir/distributed_data_object.abc"
73  output = distributed_data_object_abc_obj_path
74  dep = ":gen_distributed_data_object_abc"
75}
76
77ohos_shared_library("distributeddataobject") {
78  branch_protector_ret = "pac_ret"
79  sanitize = {
80    cfi = true
81    cfi_cross_dso = true
82    debug = false
83  }
84  part_name = "data_object"
85  sources = [
86    "../../frameworks/jskitsimpl/src/adaptor/js_distributedobject.cpp",
87    "../../frameworks/jskitsimpl/src/adaptor/js_distributedobjectstore.cpp",
88    "../../frameworks/jskitsimpl/src/adaptor/js_module_init.cpp",
89    "../../frameworks/jskitsimpl/src/adaptor/js_object_wrapper.cpp",
90    "../../frameworks/jskitsimpl/src/adaptor/js_watcher.cpp",
91    "../../frameworks/jskitsimpl/src/adaptor/notifier_impl.cpp",
92    "../../frameworks/jskitsimpl/src/common/js_ability.cpp",
93    "../../frameworks/jskitsimpl/src/common/js_util.cpp",
94    "../../frameworks/jskitsimpl/src/common/napi_queue.cpp",
95    "../../frameworks/jskitsimpl/src/common/object_error.cpp",
96    "../../frameworks/jskitsimpl/src/common/uv_queue.cpp",
97  ]
98
99  configs = [ ":objectstore_config" ]
100
101  deps = [
102    ":distributed_data_object_abc",
103    ":distributed_data_object_js",
104    "//foundation/distributeddatamgr/data_object/interfaces/innerkits:distributeddataobject_impl",
105    "//third_party/bounds_checking_function:libsec_shared",
106    "//third_party/libuv:uv",
107  ]
108  external_deps = [
109    "ability_runtime:abilitykit_native",
110    "ability_runtime:app_context",
111    "ability_runtime:napi_base_context",
112    "access_token:libaccesstoken_sdk",
113    "common_event_service:cesfwk_innerkits",
114    "hilog:libhilog",
115    "kv_store:distributeddb",
116    "napi:ace_napi",
117  ]
118
119  public_configs = [ ":objectstore_public_config" ]
120  relative_install_dir = "module/data"
121  subsystem_name = "distributeddatamgr"
122}
123