chromium/chrome/browser/media/router/discovery/BUILD.gn

# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")

assert(!is_android)
assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome")

static_library("discovery") {
  inputs = [ "$root_gen_dir/chrome/grit/generated_resources.h" ]
  sources = [
    "dial/device_description_fetcher.cc",
    "dial/device_description_fetcher.h",
    "dial/device_description_service.cc",
    "dial/device_description_service.h",
    "dial/dial_app_discovery_service.cc",
    "dial/dial_app_discovery_service.h",
    "dial/dial_device_data.cc",
    "dial/dial_device_data.h",
    "dial/dial_media_sink_service.cc",
    "dial/dial_media_sink_service.h",
    "dial/dial_media_sink_service_impl.cc",
    "dial/dial_media_sink_service_impl.h",
    "dial/dial_registry.cc",
    "dial/dial_registry.h",
    "dial/dial_service.h",
    "dial/dial_service_impl.cc",
    "dial/dial_service_impl.h",
    "dial/dial_url_fetcher.cc",
    "dial/dial_url_fetcher.h",
    "dial/parsed_dial_app_info.cc",
    "dial/parsed_dial_app_info.h",
    "dial/parsed_dial_device_description.cc",
    "dial/parsed_dial_device_description.h",
    "dial/safe_dial_app_info_parser.cc",
    "dial/safe_dial_app_info_parser.h",
    "dial/safe_dial_device_description_parser.cc",
    "dial/safe_dial_device_description_parser.h",
    "discovery_network_info.cc",
    "discovery_network_info.h",
    "discovery_network_list.h",
    "discovery_network_list_wifi.h",
    "discovery_network_monitor.cc",
    "discovery_network_monitor.h",
    "mdns/cast_media_sink_service.cc",
    "mdns/cast_media_sink_service.h",
    "mdns/cast_media_sink_service_impl.cc",
    "mdns/cast_media_sink_service_impl.h",
    "mdns/dns_sd_delegate.cc",
    "mdns/dns_sd_delegate.h",
    "mdns/dns_sd_device_lister.cc",
    "mdns/dns_sd_device_lister.h",
    "mdns/dns_sd_registry.cc",
    "mdns/dns_sd_registry.h",
    "mdns/media_sink_util.cc",
    "mdns/media_sink_util.h",
    "media_sink_discovery_metrics.cc",
    "media_sink_discovery_metrics.h",
  ]
  deps = [
    "//base",
    "//base:i18n",
    "//build:chromeos_buildflags",
    "//chrome/app:generated_resources",
    "//chrome/browser:browser_process",
    "//chrome/browser/media/router:data_decoder_util",
    "//chrome/browser/media/router:logger_list",
    "//chrome/browser/media/router:media_router_feature",
    "//chrome/common:constants",
    "//components/media_router/browser",
    "//components/media_router/common",
    "//components/media_router/common/mojom:logger",
    "//components/media_router/common/providers/cast/channel",
    "//components/net_log",
    "//components/prefs",
    "//components/version_info",
    "//content/public/browser",
    "//content/public/common",
    "//services/network/public/cpp",
    "//third_party/openscreen/src/cast/common/channel/proto:channel_proto",
  ]
  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  if (is_linux || is_chromeos) {
    sources += [ "discovery_network_list_wifi_linux.cc" ]
  }

  if (is_chromeos_ash) {
    deps += [ "//chromeos/ash/components/network" ]
  }

  if (is_posix) {
    sources += [ "discovery_network_list_posix.cc" ]
  }

  if (is_mac) {
    sources += [ "discovery_network_list_wifi_mac.mm" ]
    frameworks = [ "CoreWLAN.framework" ]
  }

  if (is_win) {
    sources += [
      "discovery_network_list_win.cc",
      "discovery_network_list_win.h",
    ]
    libs = [ "iphlpapi.lib" ]
  }
}

source_set("test_support") {
  testonly = true

  cflags = []

  sources = []

  if (is_win) {
    # Disable warnings about deprecated declarations in Windows SDK headers.
    # FakeConnectionProfile implements the WinRT interface IConnectionProfile,
    # which contains a few deprecated functions that are not used by Chromium.
    cflags += [ "-Wno-deprecated-declarations" ]

    sources += [
      "test_support/win/fake_connection_profile.cc",
      "test_support/win/fake_connection_profile.h",
      "test_support/win/fake_ip_adapter_addresses.cc",
      "test_support/win/fake_ip_adapter_addresses.h",
      "test_support/win/fake_ip_helper.cc",
      "test_support/win/fake_ip_helper.h",
      "test_support/win/fake_mib_table.cc",
      "test_support/win/fake_mib_table.h",
      "test_support/win/fake_network_adapter.cc",
      "test_support/win/fake_network_adapter.h",
      "test_support/win/fake_network_information_statics.cc",
      "test_support/win/fake_network_information_statics.h",
      "test_support/win/fake_vector_view.h",
      "test_support/win/fake_winrt_network_environment.cc",
      "test_support/win/fake_winrt_network_environment.h",
      "test_support/win/fake_wlan_connection_profile_details.cc",
      "test_support/win/fake_wlan_connection_profile_details.h",
    ]
  }
  deps = [ "//base" ]
}