# 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("//build_overrides/nlunit_test.gni")
import("${chip_root}/src/platform/device.gni")

source_set("constants") {
  sources = [ "Constants.h" ]

  public_deps = [ "${chip_root}/src/lib/support" ]
}

source_set("types") {
  sources = [ "Types.h" ]
}

source_set("naming") {
  sources = [
    "ServiceNaming.cpp",
    "ServiceNaming.h",
  ]

  public_deps = [
    ":constants",
    ":types",
    "${chip_root}/src/lib/core",
    "${chip_root}/src/lib/core:error",
    "${chip_root}/src/lib/support:span",
  ]
}

source_set("platform_header") {
  sources = [
    "platform/Dnssd.h",
    "platform/DnssdBrowseDelegate.h",
  ]
  public_deps = [
    ":constants",
    ":naming",
    "${chip_root}/src/inet",
    "${chip_root}/src/lib/core",
    "${chip_root}/src/system",
  ]
}

static_library("dnssd") {
  public_deps = [
    ":constants",
    ":platform_header",
    ":types",
    "${chip_root}/src/app/icd/server:icd-server-config",
    "${chip_root}/src/crypto",
    "${chip_root}/src/lib/core",
    "${chip_root}/src/lib/support",
    "${chip_root}/src/messaging:configurations",
  ]

  sources = [
    "Advertiser.h",
    "IPAddressSorter.cpp",
    "IPAddressSorter.h",
    "Resolver.h",
    "ResolverProxy.cpp",
    "ResolverProxy.h",
    "TxtFields.cpp",
    "TxtFields.h",
  ]

  if (chip_mdns == "none") {
    sources += [
      "Advertiser_ImplNone.cpp",
      "Resolver_ImplNone.cpp",
    ]
  } else if (chip_mdns == "minimal") {
    sources += [
      "ActiveResolveAttempts.cpp",
      "ActiveResolveAttempts.h",
      "Advertiser_ImplMinimalMdns.cpp",
      "Advertiser_ImplMinimalMdnsAllocator.h",
      "IncrementalResolve.cpp",
      "IncrementalResolve.h",
      "MinimalMdnsServer.cpp",
      "MinimalMdnsServer.h",
      "Resolver_ImplMinimalMdns.cpp",
    ]
    public_deps += [
      "${chip_root}/src/lib/dnssd/minimal_mdns",
      "${chip_root}/src/tracing",
      "${chip_root}/src/tracing:macros",
    ]
  } else if (chip_mdns == "platform") {
    sources += [
      "Discovery_ImplPlatform.cpp",
      "Discovery_ImplPlatform.h",
    ]
    public_deps += [ "${chip_root}/src/platform" ]
  } else {
    assert(false, "Unknown Dnssd advertiser implementation.")
  }

  cflags = [ "-Wconversion" ]
}
