chromium/components/device_signals/core/common/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.

static_library("common") {
  public = [
    "cached_signal.h",
    "common_types.h",
    "platform_utils.h",
    "signals_constants.h",
  ]

  sources = [
    "common_types.cc",
    "signals_constants.cc",
  ]

  public_deps = [ "//third_party/abseil-cpp:absl" ]

  deps = [ "//base" ]

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

  if (is_mac || is_linux) {
    sources += [ "posix/platform_utils_posix.cc" ]
  }

  if (is_mac) {
    sources += [ "mac/platform_utils_mac.cc" ]
  }
}

source_set("features") {
  public = [ "signals_features.h" ]

  sources = [ "signals_features.cc" ]

  public_deps = [ "//base" ]
}

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

  deps = [
    ":common",
    ":features",
    "//base",
    "//base/test:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
  if (is_win) {
    deps += [ "//components/device_signals/core/common/win:unit_tests" ]
  }
}