# 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/access/access.gni")
import("${chip_root}/src/app/common_flags.gni")
import("${chip_root}/src/app/icd/icd.gni")

config("server_config") {
  defines = []

  if (chip_app_use_echo) {
    defines += [ "CHIP_APP_USE_ECHO" ]
  }
}

static_library("server") {
  output_name = "libCHIPAppServer"

  sources = [
    "AclStorage.cpp",
    "AclStorage.h",
    "AppDelegate.h",
    "CommissioningModeProvider.h",
    "CommissioningWindowManager.cpp",
    "CommissioningWindowManager.h",
    "DefaultAclStorage.cpp",
    "DefaultAclStorage.h",
    "Dnssd.cpp",
    "Dnssd.h",
    "EchoHandler.cpp",
    "EchoHandler.h",
    "OnboardingCodesUtil.cpp",
    "OnboardingCodesUtil.h",
    "Server.cpp",
    "Server.h",
  ]

  public_configs = [ ":server_config" ]

  cflags = [ "-Wconversion" ]

  public_deps = [
    "${chip_root}/src/app",
    "${chip_root}/src/app:test-event-trigger",
    "${chip_root}/src/app/icd/server:icd-server-config",
    "${chip_root}/src/app/icd/server:observer",
    "${chip_root}/src/lib/address_resolve",
    "${chip_root}/src/lib/dnssd",
    "${chip_root}/src/lib/dnssd:naming",
    "${chip_root}/src/messaging",
    "${chip_root}/src/platform",
    "${chip_root}/src/protocols",
    "${chip_root}/src/setup_payload",
    "${chip_root}/src/transport",
  ]

  # TODO: Server.cpp uses TestGroupData.h. Unsure why test code would be in such a central place
  #       This dependency is split since it should probably be removed (or naming should
  #       be updated if this is not really "testing" even though headers are Test*.h)
  public_deps += [ "${chip_root}/src/lib/support:testing" ]

  if (chip_enable_icd_server) {
    public_deps += [ "${chip_root}/src/app/icd/server:notifier" ]

    if (chip_enable_icd_checkin) {
      public_deps +=
          [ "${chip_root}/src/app/icd/server:default-check-in-back-off" ]
    }
  }
}
