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