#
#  Copyright 2021 Google, Inc.
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at:
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#

source_set("BluetoothMetricsSources_chromeos") {
  sources = [
    "chromeos/metrics.cc",
    "chromeos/metrics_allowlist.cc",
    "chromeos/metrics_event.cc",
  ]

  deps = [ "//bt/system/gd:gd_default_deps" ]
  configs += [
    "//bt/system/gd:gd_defaults",
    "//bt/system/log:log_defaults",
  ]
}

source_set("BluetoothMetricsSources_linux") {
  sources = [ "linux/metrics.cc" ]
  configs += [
    "//bt/system/gd:gd_defaults",
    "//bt/system/log:log_defaults",
  ]
}

source_set("BluetoothMetricsSources") {
  sources = [
    "counter_metrics.cc",
    "utils.cc",
  ]

  configs += [
    "//bt/system/gd:gd_defaults",
    "//bt/system/log:log_defaults",
  ]
  deps = [ "//bt/system/gd:gd_default_deps" ]

  if (target_os == "chromeos") {
    deps += [ ":BluetoothMetricsSources_chromeos" ]
  } else {
    deps += [ ":BluetoothMetricsSources_linux" ]
  }
}
