#
#  Copyright 2024 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.
#

config("metrics_config") {
  include_dirs = [
    "//bt/system/metrics/include",
    "//bt/system/types/include",
  ]
}

static_library("metrics") {
  cflags = [ "-fvisibility=default" ]
  sources = [
    "src/bluetooth_event.cc",
    "src/metric_id_api.cc",
    "src/metric_id_manager.cc",
  ]
  public_deps = [
    "//external/proto_logging/stats/enums/bluetooth:libbt-platform-protos-lite",
  ]
  public_configs = [ ":metrics_config" ]
  configs += [
    "//bt/system:target_defaults",
    "//bt/system/log:log_defaults",
  ]

  if (target_os == "chromeos") {
    sources += [ "src/chromeos/metrics.cc" ]
  } else {
    sources += [ "src/host/metrics.cc" ]
  }
}
