# Copyright (c) 2020 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}/src/app/common_flags.gni")
import("${chip_root}/src/lib/lib.gni")
import("${chip_root}/src/platform/device.gni")
import("${chip_root}/src/platform/python.gni")

source_set("nodatamodel") {
  sources = [ "EmptyDataModelHandler.cpp" ]

  public_deps = [ "${chip_root}/src/app" ]
}

static_library("controller") {
  output_name = "libChipController"

  sources = [ "CHIPCluster.h" ]

  if (chip_controller && chip_build_controller) {
    sources += [
      "AbstractDnssdDiscoveryController.cpp",
      "AutoCommissioner.cpp",
      "AutoCommissioner.h",
      "CHIPCommissionableNodeController.cpp",
      "CHIPCommissionableNodeController.h",
      "CHIPDeviceControllerFactory.cpp",
      "CHIPDeviceControllerFactory.h",
      "CommissioneeDeviceProxy.cpp",
      "CommissioneeDeviceProxy.h",
      "CommissionerDiscoveryController.cpp",
      "CommissionerDiscoveryController.h",
      "CommissioningDelegate.cpp",
      "DeviceDiscoveryDelegate.h",
      "DevicePairingDelegate.h",
      "ExampleOperationalCredentialsIssuer.cpp",
      "ExampleOperationalCredentialsIssuer.h",
      "SetUpCodePairer.cpp",
      "SetUpCodePairer.h",
    ]
    if (chip_enable_read_client) {
      sources += [
        "CHIPDeviceController.cpp",
        "CHIPDeviceController.h",
        "CommissioningWindowOpener.cpp",
        "CommissioningWindowOpener.h",
        "CurrentFabricRemover.cpp",
        "CurrentFabricRemover.h",
      ]
    }
  }

  cflags = [ "-Wconversion" ]

  public_deps = [
    "${chip_root}/src/app",
    "${chip_root}/src/app/server",
    "${chip_root}/src/lib/core",
    "${chip_root}/src/lib/dnssd",
    "${chip_root}/src/lib/support",
    "${chip_root}/src/messaging",
    "${chip_root}/src/platform",
    "${chip_root}/src/protocols",
    "${chip_root}/src/setup_payload",
    "${chip_root}/src/tracing",
    "${chip_root}/src/tracing:macros",
    "${chip_root}/src/transport",
  ]

  deps = [ "${chip_root}/src/lib/address_resolve" ]

  defines = []
}
