1# Copyright (C) 2019 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import("../../../gn/perfetto_component.gni")
16import("../../../gn/test.gni")
17
18# Used by two static libs - trace_processor and libpprofbuilder, hence using
19# perfetto_component to turn this into a cc_library in bazel builds.
20# The 'public' section gets converted to 'hdrs', and is necessary for the bazel
21# build to pass strict header checks.
22perfetto_component("containers") {
23  public = [
24    "bit_vector.h",
25    "bit_vector_iterators.h",
26    "null_term_string_view.h",
27    "nullable_vector.h",
28    "row_map.h",
29    "string_pool.h",
30  ]
31  sources = [
32    "bit_vector.cc",
33    "bit_vector_iterators.cc",
34    "nullable_vector.cc",
35    "row_map.cc",
36    "string_pool.cc",
37  ]
38  deps = [
39    "../../../gn:default_deps",
40    "../../../include/perfetto/protozero",
41    "../../base",
42  ]
43}
44
45perfetto_unittest_source_set("unittests") {
46  testonly = true
47  sources = [
48    "bit_vector_unittest.cc",
49    "null_term_string_view_unittest.cc",
50    "nullable_vector_unittest.cc",
51    "row_map_unittest.cc",
52    "string_pool_unittest.cc",
53  ]
54  deps = [
55    ":containers",
56    "../../../gn:default_deps",
57    "../../../gn:gtest_and_gmock",
58  ]
59}
60
61if (enable_perfetto_benchmarks) {
62  source_set("benchmarks") {
63    testonly = true
64    deps = [
65      ":containers",
66      "../../../gn:benchmark",
67      "../../../gn:default_deps",
68    ]
69    sources = [
70      "bit_vector_benchmark.cc",
71      "nullable_vector_benchmark.cc",
72      "row_map_benchmark.cc",
73    ]
74  }
75}
76