# 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("../../time.gni")

config("time_client_config") {
  include_dirs = [
    "${time_service_path}/ipc/proxy/inner_api_include",
    "${time_service_path}/ipc/stub/inner_api_include",
    "${time_service_path}/ipc/base",
    "include",
    "${time_utils_path}/native/include",
    "${time_service_path}/time/include/inner_api_include",
    "${time_service_path}/timer/include",
  ]
}

ohos_shared_library("time_client") {
  sources = [
    "${api_path}/src/time_service_client.cpp",
    "${time_service_path}/ipc/proxy/time_service_proxy.cpp",
    "${time_service_path}/ipc/proxy/timer_notify_callback_proxy.cpp",
    "${time_service_path}/ipc/stub/timer_call_back_stub.cpp",
    "${time_service_path}/time/src/itimer_info.cpp",
    "${time_service_path}/time/src/timer_call_back.cpp",
  ]
  configs = [ ":time_client_config" ]
  configs += [ "//build/config/gcc:symbol_visibility_hidden" ]
  public_configs = [ ":time_client_config" ]
  innerapi_tags = [
    "platformsdk",
    "sasdk",
  ]
  external_deps = [
    "ability_runtime:abilitykit_native",
    "ability_runtime:extensionkit_native",
    "ability_runtime:wantagent_innerkits",
    "c_utils:utils",
    "hilog:libhilog",
    "ipc:ipc_single",
    "samgr:samgr_proxy",
  ]
  branch_protector_ret = "pac_ret"
  sanitize = {
    integer_overflow = true
    ubsan = true
    boundary_sanitize = true
    cfi = true
    cfi_cross_dso = true
    debug = time_sanitize_debug
  }
  subsystem_name = "time"
  part_name = "time_service"
}