chromium/extensions/browser/api/audio/BUILD.gn

# Copyright 2016 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")
import("//extensions/buildflags/buildflags.gni")

assert(enable_extensions,
       "Cannot depend on extensions because enable_extensions=false.")

source_set("audio") {
  sources = [
    "audio_api.cc",
    "audio_api.h",
    "audio_device_id_calculator.cc",
    "audio_device_id_calculator.h",
    "audio_service.h",
    "pref_names.cc",
    "pref_names.h",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  public_deps = [ "//extensions/browser:browser_sources" ]

  deps = [
    "//components/prefs",
    "//extensions/common",
    "//extensions/common/api",
  ]

  if (is_chromeos) {
    sources += [
      "audio_service_utils.cc",
      "audio_service_utils.h",
    ]
    deps += [ "//chromeos/crosapi/mojom" ]
  }

  if (is_chromeos_ash) {
    deps += [
      "//chromeos/ash/components/audio",
      "//content/public/browser",
    ]
    sources += [ "audio_service_chromeos.cc" ]
  } else if (is_chromeos_lacros) {
    deps += [
      "//chromeos/crosapi/cpp",
      "//chromeos/lacros",
    ]
    sources += [
      "audio_service_lacros.cc",
      "audio_service_lacros.h",
    ]
  } else {
    sources += [ "audio_service.cc" ]
  }
}