xref: /aosp_15_r20/external/perfetto/src/trace_processor/containers/BUILD.gn (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
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    "implicit_segment_forest.h",
26    "interval_intersector.h",
27    "interval_tree.h",
28    "null_term_string_view.h",
29    "row_map.h",
30    "row_map_algorithms.h",
31    "string_pool.h",
32  ]
33  sources = [
34    "bit_vector.cc",
35    "row_map.cc",
36    "string_pool.cc",
37  ]
38  deps = [
39    "../../../gn:default_deps",
40    "../../../include/perfetto/protozero",
41    "../../../protos/perfetto/trace_processor:zero",
42    "../../base",
43  ]
44}
45
46perfetto_unittest_source_set("unittests") {
47  testonly = true
48  sources = [
49    "bit_vector_unittest.cc",
50    "implicit_segment_forest_unittest.cc",
51    "interval_intersector_unittest.cc",
52    "interval_tree_unittest.cc",
53    "null_term_string_view_unittest.cc",
54    "row_map_unittest.cc",
55    "string_pool_unittest.cc",
56  ]
57  deps = [
58    ":containers",
59    "../../../gn:default_deps",
60    "../../../gn:gtest_and_gmock",
61    "../../../include/perfetto/protozero",
62    "../../../protos/perfetto/trace_processor:zero",
63  ]
64}
65
66if (enable_perfetto_benchmarks) {
67  source_set("benchmarks") {
68    testonly = true
69    deps = [
70      ":containers",
71      "../../../gn:benchmark",
72      "../../../gn:default_deps",
73      "../../base",
74    ]
75    sources = [
76      "bit_vector_benchmark.cc",
77      "row_map_algorithms_benchmark.cc",
78      "row_map_benchmark.cc",
79    ]
80  }
81}
82