153c3577eSopenharmony_ci# Copyright (c) 2021 Huawei Device Co., Ltd.
253c3577eSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
353c3577eSopenharmony_ci# you may not use this file except in compliance with the License.
453c3577eSopenharmony_ci# You may obtain a copy of the License at
553c3577eSopenharmony_ci#
653c3577eSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
753c3577eSopenharmony_ci#
853c3577eSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
953c3577eSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1053c3577eSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1153c3577eSopenharmony_ci# See the License for the specific language governing permissions and
1253c3577eSopenharmony_ci# limitations under the License.
1353c3577eSopenharmony_ciimport("//build/ohos.gni")
1453c3577eSopenharmony_ciimport("//build/ohos_var.gni")
1553c3577eSopenharmony_ciimport("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni")
1653c3577eSopenharmony_ci
1753c3577eSopenharmony_ciconfig("distributeddata_adapter_private_config") {
1853c3577eSopenharmony_ci  visibility = [ ":*" ]
1953c3577eSopenharmony_ci  include_dirs = []
2053c3577eSopenharmony_ci
2153c3577eSopenharmony_ci  cflags = [ "-Wno-multichar" ]
2253c3577eSopenharmony_ci
2353c3577eSopenharmony_ci  cflags_cc = [ "-fvisibility=hidden" ]
2453c3577eSopenharmony_ci  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
2553c3577eSopenharmony_ci}
2653c3577eSopenharmony_ci
2753c3577eSopenharmony_ciconfig("distributeddata_adapter_public_config") {
2853c3577eSopenharmony_ci  visibility = [ ":*" ]
2953c3577eSopenharmony_ci
3053c3577eSopenharmony_ci  include_dirs = [
3153c3577eSopenharmony_ci    "include/log",
3253c3577eSopenharmony_ci    "include/dfx",
3353c3577eSopenharmony_ci    "include/communicator",
3453c3577eSopenharmony_ci    "include/autils",
3553c3577eSopenharmony_ci    "include/utils",
3653c3577eSopenharmony_ci    "include",
3753c3577eSopenharmony_ci    "${kv_store_path}/interfaces/innerkits/distributeddata/include/",
3853c3577eSopenharmony_ci    "${kv_store_common_path}",
3953c3577eSopenharmony_ci    "${data_service_path}/framework/include",
4053c3577eSopenharmony_ci  ]
4153c3577eSopenharmony_ci}
4253c3577eSopenharmony_ci
4353c3577eSopenharmony_ciohos_shared_library("distributeddata_adapter") {
4453c3577eSopenharmony_ci  branch_protector_ret = "pac_ret"
4553c3577eSopenharmony_ci  sanitize = {
4653c3577eSopenharmony_ci    cfi = true
4753c3577eSopenharmony_ci    cfi_cross_dso = true
4853c3577eSopenharmony_ci    debug = false
4953c3577eSopenharmony_ci    boundary_sanitize = true
5053c3577eSopenharmony_ci    integer_overflow = true
5153c3577eSopenharmony_ci    ubsan = true
5253c3577eSopenharmony_ci  }
5353c3577eSopenharmony_ci  sources = []
5453c3577eSopenharmony_ci  cflags = [ "-D_LIBCPP_HAS_COND_CLOCKWAIT" ]
5553c3577eSopenharmony_ci  configs = [ ":distributeddata_adapter_private_config" ]
5653c3577eSopenharmony_ci  deps = [
5753c3577eSopenharmony_ci    "${data_service_path}/adapter/account:distributeddata_account_static",
5853c3577eSopenharmony_ci    "${data_service_path}/adapter/communicator:distributeddata_communicator_static",
5953c3577eSopenharmony_ci    "${data_service_path}/adapter/dfx:distributeddata_dfx_static",
6053c3577eSopenharmony_ci    "${data_service_path}/adapter/permission:distributeddata_permission_static",
6153c3577eSopenharmony_ci    "${data_service_path}/framework:distributeddatasvcfwk",
6253c3577eSopenharmony_ci  ]
6353c3577eSopenharmony_ci
6453c3577eSopenharmony_ci  if (defined(global_parts_info) &&
6553c3577eSopenharmony_ci      defined(global_parts_info.theme_screenlock_mgr)) {
6653c3577eSopenharmony_ci    deps += [ "${data_service_path}/adapter/screenlock:distributeddata_screenlock_static" ]
6753c3577eSopenharmony_ci  }
6853c3577eSopenharmony_ci
6953c3577eSopenharmony_ci  external_deps = [
7053c3577eSopenharmony_ci    "c_utils:utils",
7153c3577eSopenharmony_ci    "hilog:libhilog",
7253c3577eSopenharmony_ci    "hisysevent:libhisysevent",
7353c3577eSopenharmony_ci    "hitrace:hitrace_meter",
7453c3577eSopenharmony_ci    "hitrace:libhitracechain",
7553c3577eSopenharmony_ci  ]
7653c3577eSopenharmony_ci  public_external_deps = [ "device_manager:devicemanagersdk" ]
7753c3577eSopenharmony_ci  public_configs = [ ":distributeddata_adapter_public_config" ]
7853c3577eSopenharmony_ci
7953c3577eSopenharmony_ci  subsystem_name = "distributeddatamgr"
8053c3577eSopenharmony_ci  part_name = "datamgr_service"
8153c3577eSopenharmony_ci}
82