# Copyright (c) 2023 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("../../windowmanager_aafwk.gni")

config("screen_session_manager_client_public_config") {
  include_dirs = [
    "include",
    "${window_base_path}/dm/include",
    "${window_base_path}/dmserver/include",
    "${window_base_path}/interfaces/innerkits/dm",
    "${window_base_path}/interfaces/innerkits/wm",
    "${window_base_path}/utils/include",
    "${window_base_path}/window_scene",
    "${window_base_path}/window_scene/screen_session_manager/include",
    "${window_base_path}/window_scene/session_manager/include",
    "${window_base_path}/window_scene/screen_session_manager_client/include",
  ]
}

ohos_shared_library("screen_session_manager_client") {
  branch_protector_ret = "pac_ret"
  sanitize = {
    cfi = true
    cfi_cross_dso = true
    cfi_vcall_icall_only = true
    debug = false
    cfi_policy = "adaptive"
  }
  sources = [
    "../screen_session_manager/src/zidl/screen_session_manager_proxy.cpp",
    "src/screen_session_manager_client.cpp",
    "src/zidl/screen_session_manager_client_stub.cpp",
    "../screen_session_manager/src/rs_event_data_manager.cpp",
  ]

  public_configs = [ ":screen_session_manager_client_public_config" ]

  deps = [
    "${window_base_path}/utils:libwmutil",
    "${window_base_path}/utils:libwmutil_base",
    "${window_base_path}/window_scene/session:screen_session",
  ]

  external_deps = [
    "ability_base:base",
    "ability_base:want",
    "accessibility:accessibility_common",
    "c_utils:utils",
    "ffrt:libffrt",
    "graphic_2d:librender_service_base",
    "graphic_2d:librender_service_client",
    "hilog:libhilog",
    "hitrace:hitrace_meter",
    "image_framework:image_native",
    "init:libbegetutil",
    "ipc:ipc_single",
    "safwk:system_ability_fwk",
    "samgr:samgr_proxy",
  ]

  innerapi_tags = [ "platformsdk" ]
  part_name = "window_manager"
  subsystem_name = "window"

  defines = []
  if (build_variant == "user") {
    defines += [ "IS_RELEASE_VERSION" ]
  }
  ldflags = [ "-Wl,-Bsymbolic-functions" ]
}