# Copyright (c) 2025 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")

ohos_ndk_library("libteec") {
  output_name = "teec"
  output_extension = "so"
  ndk_description_file = "./libteec.ndk.json"
  min_compact_version = "20"
  system_capability = "SystemCapability.Tee.TeeClient"
  system_capability_headers = [
    "TEEKit/tee_client/tee_client_api.h",
    "TEEKit/tee_client/tee_client_constants.h",
    "TEEKit/tee_client/tee_client_type.h",
  ]
}

ohos_ndk_headers("libtee_header") {
  dest_dir = "$ndk_headers_out_dir/TEEKit/tee"
  sources = [
    "./include/tee/pthread_attr.h",
    "./include/tee/tee_agent.h",
    "./include/tee/tee_arith_api.h",
    "./include/tee/tee_core_api.h",
    "./include/tee/tee_crypto_api.h",
    "./include/tee/tee_crypto_hal.h",
    "./include/tee/tee_defines.h",
    "./include/tee/tee_drv_client.h",
    "./include/tee/tee_ext_api.h",
    "./include/tee/tee_log.h",
    "./include/tee/tee_mem_mgmt_api.h",
    "./include/tee/tee_object_api.h",
    "./include/tee/tee_property_api.h",
    "./include/tee/tee_sharemem_ops.h",
    "./include/tee/tee_time_api.h",
    "./include/tee/tee_trusted_storage_api.h",
  ]
}

ohos_ndk_headers("libteec_header") {
  dest_dir = "$ndk_headers_out_dir/TEEKit/tee_client"
  sources = [
    "./include/tee_client/tee_client_api.h",
    "./include/tee_client/tee_client_constants.h",
    "./include/tee_client/tee_client_type.h",
  ]
}

group("tee_ndk_header") {
  deps = [
    ":libtee_header",
    ":libteec_header",
  ]
}