# Copyright (c) 2021 Project CHIP Authors
#
# 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_overrides/chip.gni")
import("${chip_root}/build/chip/buildconfig_header.gni")
import("${chip_root}/src/access/access.gni")

buildconfig_header("access_buildconfig") {
  header = "AccessBuildConfig.h"
  header_dir = "access"

  defines = [
    "CHIP_CONFIG_USE_ACCESS_RESTRICTIONS=${chip_enable_access_restrictions}",
  ]

  visibility = [ ":access_config" ]
}

source_set("access_config") {
  sources = [ "AccessConfig.h" ]

  deps = [ ":access_buildconfig" ]
}

source_set("types") {
  sources = [
    "AuthMode.h",
    "Privilege.h",
    "RequestPath.h",
    "SubjectDescriptor.h",
  ]

  public_deps = [
    ":access_config",
    "${chip_root}/src/lib/core",
    "${chip_root}/src/lib/core:types",
  ]
}

static_library("access") {
  output_name = "libaccess"

  sources = [
    "AccessControl.cpp",
    "AccessControl.h",
    "examples/ExampleAccessControlDelegate.cpp",
    "examples/ExampleAccessControlDelegate.h",
    "examples/PermissiveAccessControlDelegate.cpp",
    "examples/PermissiveAccessControlDelegate.h",
  ]

  cflags = [ "-Wconversion" ]

  public_deps = [
    ":access_config",
    ":types",
    "${chip_root}/src/lib/core",
    "${chip_root}/src/lib/core:types",
    "${chip_root}/src/lib/support",
    "${chip_root}/src/platform",
  ]

  if (chip_enable_access_restrictions) {
    sources += [
      "AccessRestrictionProvider.cpp",
      "AccessRestrictionProvider.h",
    ]
  }
}

source_set("provider-impl") {
  sources = [ "ProviderDeviceTypeResolver.h" ]

  public_deps = [
    ":access",
    "${chip_root}/src/app/data-model-provider",
  ]
}
