chromium/services/media_session/public/cpp/BUILD.gn

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

# The thin target that does not depend on mojom.
component("base_cpp") {
  output_name = "media_session_base_cpp"

  sources = [
    "chapter_information.cc",
    "chapter_information.h",
    "media_image.cc",
    "media_image.h",
    "media_metadata.cc",
    "media_metadata.h",
    "media_position.cc",
    "media_position.h",
  ]

  deps = [
    "//base",
    "//ui/gfx/geometry",
    "//url",
  ]

  # TODO: Remove this (http://crbug.com/101600).
  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  if (is_android) {
    sources += [
      "media_image_android.cc",
      "media_metadata_android.cc",
      "media_position_android.cc",
    ]
    deps += [ "android:media_session_jni_headers" ]
  }

  defines = [ "IS_MEDIA_SESSION_BASE_CPP_IMPL" ]
}

component("cpp") {
  output_name = "media_session_cpp"

  sources = [
    "features.cc",
    "features.h",
    "media_image_manager.cc",
    "media_image_manager.h",
    "media_session_service.h",
    "util.cc",
    "util.h",
  ]

  public_deps = [ ":base_cpp" ]

  deps = [
    "//base",
    "//build:chromeos_buildflags",
    "//services/media_session/public/mojom",
    "//skia",
    "//ui/gfx/geometry",
    "//url",
  ]

  # TODO: Remove this (http://crbug.com/101600).
  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  defines = [ "IS_MEDIA_SESSION_CPP_IMPL" ]
}

source_set("tests") {
  testonly = true

  sources = [
    "media_image_manager_unittest.cc",
    "media_position_unittest.cc",
    "mojom_traits_unittest.cc",
  ]

  deps = [
    ":cpp",
    "//base",
    "//mojo/public/cpp/test_support:test_utils",
    "//services/media_session/public/mojom",
    "//skia",
    "//testing/gtest",
  ]
}