# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni") import("//build/ohos.gni") import("//build/ohos/ace/ace.gni") import("//foundation/arkui/ace_engine/ace_config.gni") import("//foundation/distributeddatamgr/data_object/data_object.gni") group("build_module") { deps = [ ":distributeddataobject" ] } # compile .js to .abc. es2abc_gen_abc("gen_distributed_data_object_abc") { extra_visibility = [ ":*" ] src_js = rebase_path("distributed_data_object.js") dst_file = rebase_path(target_out_dir + "/distributed_data_object.abc") in_puts = [ "distributed_data_object.js" ] out_puts = [ target_out_dir + "/distributed_data_object.abc" ] extra_args = [ "--module" ] } config("objectstore_config") { visibility = [ ":*" ] cflags = [ "-DHILOG_ENABLE" ] include_dirs = [ "../../frameworks/jskitsimpl/include/adaptor", "../../frameworks/jskitsimpl/include/common", "../../frameworks/innerkitsimpl/include/adaptor", "../../frameworks/innerkitsimpl/include/common", "../../frameworks/innerkitsimpl/include", "../../frameworks/innerkitsimpl/include/communicator", "../../interfaces/innerkits", "${kvstore_path}/common", "${relational_store_path}/interfaces/inner_api/common_type/include", ] } config("objectstore_public_config") { visibility = [ ":*" ] include_dirs = [ "." ] } base_output_path = get_label_info(":distributed_data_object_js", "target_out_dir") distributed_data_object_js_obj_path = base_output_path + "/distributed_data_object.o" gen_js_obj("distributed_data_object_js") { input = "distributed_data_object.js" output = distributed_data_object_js_obj_path dep = ":gen_distributed_data_object_abc" } abc_output_path = get_label_info(":distributed_data_object_abc", "target_out_dir") distributed_data_object_abc_obj_path = abc_output_path + "/distributed_data_object_abc.o" gen_js_obj("distributed_data_object_abc") { input = "$target_out_dir/distributed_data_object.abc" output = distributed_data_object_abc_obj_path dep = ":gen_distributed_data_object_abc" } ohos_shared_library("distributeddataobject") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } part_name = "data_object" sources = [ "../../frameworks/jskitsimpl/src/adaptor/js_distributedobject.cpp", "../../frameworks/jskitsimpl/src/adaptor/js_distributedobjectstore.cpp", "../../frameworks/jskitsimpl/src/adaptor/js_module_init.cpp", "../../frameworks/jskitsimpl/src/adaptor/js_object_wrapper.cpp", "../../frameworks/jskitsimpl/src/adaptor/js_watcher.cpp", "../../frameworks/jskitsimpl/src/adaptor/notifier_impl.cpp", "../../frameworks/jskitsimpl/src/common/js_ability.cpp", "../../frameworks/jskitsimpl/src/common/js_util.cpp", "../../frameworks/jskitsimpl/src/common/napi_queue.cpp", "../../frameworks/jskitsimpl/src/common/object_error.cpp", "../../frameworks/jskitsimpl/src/common/uv_queue.cpp", ] configs = [ ":objectstore_config" ] deps = [ ":distributed_data_object_abc", ":distributed_data_object_js", "//foundation/distributeddatamgr/data_object/interfaces/innerkits:distributeddataobject_impl", "//third_party/bounds_checking_function:libsec_shared", "//third_party/libuv:uv", ] external_deps = [ "ability_runtime:abilitykit_native", "ability_runtime:app_context", "ability_runtime:napi_base_context", "access_token:libaccesstoken_sdk", "common_event_service:cesfwk_innerkits", "hilog:libhilog", "kv_store:distributeddb", "napi:ace_napi", ] public_configs = [ ":objectstore_public_config" ] relative_install_dir = "module/data" subsystem_name = "distributeddatamgr" }