# 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("platform_header") {
  sources = [ "platform/Dnssd.h" ]
}

static_library("dnssd") {
  public_deps = [
    ":platform_header",
    "${chip_root}/src/app/icd:icd_config",
    "${chip_root}/src/crypto",
    "${chip_root}/src/lib/core",
    "${chip_root}/src/lib/support",
    "${chip_root}/src/messaging:messaging_mrp_config",
  ]

  sources = [
    "Advertiser.h",
    "IPAddressSorter.cpp",
    "IPAddressSorter.h",
    "Resolver.h",
    "ResolverProxy.cpp",
    "ResolverProxy.h",
    "ServiceNaming.cpp",
    "ServiceNaming.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",
      "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" ]
}
