# 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/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",
    "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" ]
}
