# Copyright (c) 2021 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("//build/ohos.gni") import("//build/ohos_var.gni") import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") group("build_module") { deps = [ ":distributeddataservice" ] if (build_public_version) { deps += [ ":distributeddata_profile" ] deps += [ ":distributed_data.cfg" ] } } ohos_prebuilt_etc("distributed_data.cfg") { source = "distributed_data.cfg" relative_install_dir = "init" subsystem_name = "distributeddatamgr" part_name = "datamgr_service" } ohos_sa_profile("distributeddata_profile") { sources = [ "../sa_profile/1301.json" ] part_name = "datamgr_service" } config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "${kv_store_common_path}", "${kv_store_path}/frameworks/innerkitsimpl/distributeddatasvc/include", "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include", "${data_service_path}/adapter/include/account", "${data_service_path}/adapter/include/permission", "${data_service_path}/adapter/include/installer", "${data_service_path}/adapter/include/broadcaster", "${data_service_path}/adapter/include/utils", "${data_service_path}/adapter/include/dfx", "${data_service_path}/adapter/include", "${data_service_path}/app/src/session_manager", "${data_service_path}/framework/include", "${data_service_path}/service/bootstrap/include", "${data_service_path}/service/common", "${data_service_path}/service/config/include", "${data_service_path}/service/crypto/include", "${data_service_path}/service/directory/include", "${data_service_path}/service/permission/include", "${data_service_path}/service/matrix/include", "${data_service_path}/service/backup/include", "${data_service_path}/service/app_id_mapping/include", "${data_service_path}/service/kvdb", "${data_service_path}/service/waterversion", "${data_service_path}/service/dumper/include", # for ipc_core interfaces. "include", "src", "src/security", "src/backup_rule/include", ] cflags = [ "-Wno-multichar", "-D_LIBCPP_HAS_COND_CLOCKWAIT", ] cflags_cc = [ "-fvisibility=hidden" ] } ohos_shared_library("distributeddataservice") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false boundary_sanitize = true ubsan = true } sources = [ "${data_service_path}/service/common/xcollie.cpp", "src/db_info_handle_impl.cpp", "src/feature_stub_impl.cpp", "src/kvstore_account_observer.cpp", "src/kvstore_data_service.cpp", "src/kvstore_data_service_stub.cpp", "src/kvstore_device_listener.cpp", "src/kvstore_meta_manager.cpp", "src/security/security.cpp", "src/security/sensitive.cpp", "src/session_manager/route_head_handler_impl.cpp", "src/session_manager/session_manager.cpp", "src/session_manager/upgrade_manager.cpp", "src/task_manager.cpp", ] if (datamgr_service_power) { variable_sources = [ "src/backup_rule/src/charging.cpp", "src/backup_rule/src/screen_off.cpp", ] sources += variable_sources } configs = [ ":module_private_config" ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/adapter/broadcaster:distributeddata_broadcaster_static", "${data_service_path}/adapter/utils:distributeddata_utils_static", "${data_service_path}/app/src/checker:distributeddata_checker_static", "${data_service_path}/app/src/flowctrl_manager:distributeddata_flowctrl_static", "${data_service_path}/app/src/installer:distributeddata_installer_static", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", ] external_deps = [ "ability_base:base", "ability_base:want", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "dataclassification:data_transit_mgr", "file_api:securitylabel", "hicollie:libhicollie", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "hitrace:libhitracechain", "ipc:ipc_core", "json:nlohmann_json_static", "kv_store:distributeddata_inner", "kv_store:distributeddata_mgr", "kv_store:distributeddb", "memmgr:memmgrclient", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (datamgr_service_power) { external_deps += [ "battery_manager:batterysrv_client", "power_manager:powermgr_client", ] defines = [ "SUPPORT_POWER" ] } subsystem_name = "distributeddatamgr" part_name = "datamgr_service" defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] }