# 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")

config("want_config") {
  visibility = [ ":*" ]
  include_dirs = []
  cflags = []
  if (target_cpu == "arm") {
    cflags += [ "-DBINDER_IPC_32BIT" ]
  }
  defines = [
    "ABILITYBASE_LOG_TAG = \"Ability\"",
    "ABILITYBASE_LOG_DOMAIN = 0xD002200",
  ]
}

config("want_public_config") {
  visibility = [ ":*" ]
  include_dirs = [
    "//utils/native/base/include",
    "${ability_base_innerapi_path}/base/include",
    "${ability_base_innerapi_path}/uri/include",
    "${ability_base_innerapi_path}/want/include",
    "${innerkits_path}/log/include",
    "${kits_path}/content/cpp/src",
    "//third_party/jsoncpp/include",
    "//third_party/json/include",
  ]
}

wantImpl = "${kits_path}/content/cpp/src"

ohos_shared_library("want") {
  sources = [
    "${wantImpl}/array_wrapper.cpp",
    "${wantImpl}/element_name.cpp",
    "${wantImpl}/extra_params.cpp",
    "${wantImpl}/operation.cpp",
    "${wantImpl}/operation_builder.cpp",
    "${wantImpl}/pac_map.cpp",
    "${wantImpl}/patterns_matcher.cpp",
    "${wantImpl}/skills.cpp",
    "${wantImpl}/want.cpp",
    "${wantImpl}/want_params.cpp",
    "${wantImpl}/want_params_wrapper.cpp",
  ]

  deps = [ "//third_party/jsoncpp:jsoncpp" ]

  external_deps = [
    "ability_base:base",
    "ability_base:zuri",
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
    "utils_base:utils",
  ]

  configs = [ ":want_config" ]
  public_configs = [ ":want_public_config" ]
  subsystem_name = "aafwk"
  part_name = "ability_base"
}
