chromium/chrome/services/system_signals/BUILD.gn

# Copyright 2022 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/features.gni")

source_set("system_signals") {
  public = []

  sources = [
    "base_system_signals_service.cc",
    "base_system_signals_service.h",
  ]

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

  public_deps = [
    "//components/device_signals/core/common/mojom",
    "//mojo/public/mojom/base",
  ]

  deps = [
    "//base",
    "//components/device_signals/core/common",
  ]

  if (is_win) {
    public += [ "win/win_system_signals_service.h" ]

    sources += [
      "win/metrics_utils.cc",
      "win/metrics_utils.h",
      "win/win_system_signals_service.cc",
    ]

    public_deps += [
      "//components/device_signals/core/common/win",
      "//components/device_signals/core/system_signals/win",
    ]
  }

  if (is_mac) {
    public += [ "mac/mac_system_signals_service.h" ]

    sources += [ "mac/mac_system_signals_service.mm" ]

    deps += [ "//components/device_signals/core/system_signals/mac" ]
  }

  if (is_linux) {
    public += [ "linux/linux_system_signals_service.h" ]

    sources += [ "linux/linux_system_signals_service.cc" ]

    deps += [ "//components/device_signals/core/system_signals/posix" ]
  }
}

source_set("unit_tests") {
  testonly = true
  sources = []

  deps = [
    ":system_signals",
    "//base",
    "//base/test:test_support",
    "//components/device_signals/core/common",
    "//components/device_signals/core/common/mojom",
    "//components/device_signals/core/system_signals",
    "//components/device_signals/core/system_signals:test_support",
    "//mojo/public/mojom/base",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/abseil-cpp:absl",
  ]

  if (is_win) {
    sources += [ "win/win_system_signals_service_unittest.cc" ]

    deps += [
      "//components/device_signals/core/common/win",
      "//components/device_signals/core/system_signals/win",
      "//components/device_signals/core/system_signals/win:test_support",
    ]
  }

  if (is_mac) {
    sources += [ "mac/mac_system_signals_service_unittest.mm" ]
  }

  if (is_linux) {
    sources += [ "linux/linux_system_signals_service_unittest.cc" ]
  }
}