# 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/ability/ability_runtime/ability_runtime.gni")
import("//foundation/distributeddatamgr/relational_store/relational_store.gni")

ohos_shared_library("featureability") {
  include_dirs = [
    "./",
    "${relational_store_napi_path}/rdb/include",
    "${relational_store_napi_path}/common/include",
    "${relational_store_napi_path}/dataability/include",
  ]

  sources = [
    "${relational_store_napi_path}/common/src/js_utils.cpp",
    "${relational_store_napi_path}/dataability/src/napi_data_ability_predicates.cpp",
    "${relational_store_napi_path}/rdb/src/napi_result_set.cpp",
    "feature_ability.cpp",
    "feature_ability_constant.cpp",
    "napi_context.cpp",
    "napi_data_ability_helper.cpp",
    "napi_data_ability_operation.cpp",
    "native_module.cpp",
  ]

  deps = [
    "${ability_runtime_innerkits_path}/dataobs_manager:dataobs_manager",
    "${ability_runtime_napi_path}/inner/napi_common:napi_common",
    "//third_party/libuv:uv",
  ]

  external_deps = [
    "ability_base:want",
    "ability_base:zuri",
    "ability_runtime:ability_manager",
    "ability_runtime:abilitykit_native",
    "ability_runtime:data_ability_helper",
    "ability_runtime:napi_base_context",
    "ability_runtime:runtime",
    "bundle_framework:appexecfwk_base",
    "c_utils:utils",
    "hitrace_native:hitrace_meter",
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
    "napi:ace_napi",
    "relational_store:native_dataability",
    "relational_store:native_rdb",
    "relational_store:rdb_data_share_adapter",
  ]

  if (ability_runtime_graphics) {
    include_dirs += [
      "${windowmanager_path}/interfaces/kits/napi/window_runtime/window_napi",
    ]
    deps += [ "${windowmanager_path}/interfaces/kits/napi/window_runtime:window_native_kit" ]
    defines = [ "SUPPORT_GRAPHICS" ]
  }

  relative_install_dir = "module/ability"

  subsystem_name = "ability"
  part_name = "ability_runtime"
}
