xref: /aosp_15_r20/external/cronet/components/metrics/structured/lib/BUILD.gn (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2023 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//third_party/protobuf/proto_library.gni")
6
7# Core structured metrics library to be shared with other repos. This
8# library can only have dependencies that are part of libchrome.
9# See README.md for more details.
10source_set("lib") {
11  sources = [
12    "arena_persistent_proto.h",
13    "event_storage.h",
14    "histogram_util.cc",
15    "histogram_util.h",
16    "key_data.cc",
17    "key_data.h",
18    "key_data_file_delegate.cc",
19    "key_data_file_delegate.h",
20    "key_data_provider.cc",
21    "key_data_provider.h",
22    "key_util.cc",
23    "key_util.h",
24    "persistent_proto.h",
25    "persistent_proto_internal.cc",
26    "persistent_proto_internal.h",
27  ]
28
29  public_deps = [ ":proto" ]
30
31  deps = [
32    "//base",
33    "//crypto",
34    "//third_party/protobuf:protobuf_lite",
35  ]
36}
37
38proto_library("proto") {
39  visibility = [ "//components/metrics/structured/*" ]
40  proto_in_dir = "//"
41  generate_python = false
42  sources = [ "proto/key.proto" ]
43}
44
45source_set("unit_tests") {
46  testonly = true
47  sources = [
48    "key_data_file_delegate_unittest.cc",
49    "persistent_proto_unittest.cc",
50  ]
51  deps = [
52    ":lib",
53    ":proto",
54    "//base",
55    "//base/test:test_support",
56    "//testing/gtest",
57  ]
58}
59