chromium/media/learning/common/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.

component("common") {
  output_name = "learning_common"
  visibility = [
    "//media/learning",
    "//media/learning/common:unit_tests",
    "//media/learning/impl:*",
    "//media/learning/impl:test_support",
    "//media/learning/mojo:*",
    "//media/learning/mojo/public/cpp:*",
    "//media/learning/mojo/public/mojom:*",

    # Actual client code
    "//media/capabilities",
    "//third_party/blink/renderer/platform/media:*",

    # Test code
    "//media/mojo/services:unit_tests",
  ]

  defines = [ "IS_LEARNING_COMMON_IMPL" ]

  sources = [
    "feature_dictionary.cc",
    "feature_dictionary.h",
    "feature_library.cc",
    "feature_library.h",
    "labelled_example.cc",
    "labelled_example.h",
    "learning_session.cc",
    "learning_session.h",
    "learning_task.cc",
    "learning_task.h",
    "learning_task_controller.h",
    "media_learning_tasks.cc",
    "media_learning_tasks.h",
    "target_histogram.cc",
    "target_histogram.h",
    "value.cc",
    "value.h",
  ]

  deps = [
    "//base",
    "//services/metrics/public/cpp:metrics_cpp",
  ]

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

source_set("unit_tests") {
  testonly = true
  sources = [
    "feature_dictionary_unittest.cc",
    "labelled_example_unittest.cc",
    "media_learning_tasks_unittest.cc",
    "target_histogram_unittest.cc",
    "value_unittest.cc",
  ]

  deps = [
    ":common",
    "//base/test:test_support",
    "//media:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
}