# Copyright (c) 2021-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("//build/ohos.gni")
import("//foundation/aafwk/standard/aafwk.gni")

group("native_wantagent") {
  deps = [ ":wantagent_innerkits" ]
}

config("wantagent_innerkits_public_config") {
  visibility = [ ":*" ]

  include_dirs = [
    "${ability_base_innerapi_path}/configuration/include",
    "${global_path}/resource_management/interfaces/inner_api/include",
    "${kits_path}/ability/native/include",
    "${innerkits_path}/ability_manager/include",
    "${innerkits_path}/wantagent/include",
    "${services_path}/abilitymgr/include",
    "${innerkits_path}/app_manager/include/appmgr",
    "${bundlefwk_inner_api_path}/appexecfwk_base/include",
    "${bundlefwk_inner_api_path}/appexecfwk_core/include/bundlemgr",
    "${bundlefwk_innerkits_path}/libeventhandler/include",
    "${kits_path}/appkit/native/app/include",
    "${kits_path}/appkit/native/ability_runtime",
    "//third_party/icu/icu4c/source/common",
  ]
}

ohos_shared_library("wantagent_innerkits") {
  include_dirs = [ "${services_path}/common/include" ]

  sources = [
    "src/completed_dispatcher.cpp",
    "src/pending_want.cpp",
    "src/trigger_info.cpp",
    "src/want_agent.cpp",
    "src/want_agent_helper.cpp",
    "src/want_agent_info.cpp",
    "src/want_agent_log_wrapper.cpp",
  ]

  configs = [ "//utils/native/base:utils_config" ]

  public_configs = [ ":wantagent_innerkits_public_config" ]

  deps = [ "${kits_path}/appkit:app_context" ]

  external_deps = [
    "ability_base:want",
    "ability_runtime:ability_manager",
    "bundle_framework:appexecfwk_base",
    "bundle_framework:appexecfwk_core",
    "common_event_service:cesfwk_core",
    "eventhandler:libeventhandler",
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
    "resource_management:global_resmgr",
    "samgr_standard:samgr_proxy",
    "utils_base:utils",
  ]

  if (is_double_framework) {
    cflags = [ "-DCONFIG_DUAL_FRAMEWORK" ]
  }

  if (ability_runtime_graphics) {
    external_deps += [ "multimedia_image_standard:image_native" ]
  }

  subsystem_name = "aafwk"
  part_name = "ability_runtime"
}
