xref: /aosp_15_r20/external/pigweed/pw_allocator/benchmarks/CMakeLists.txt (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2024 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://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, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
16
17# Libraries
18
19pw_add_library(pw_allocator.benchmarks.measurements STATIC
20  HEADERS
21    public/pw_allocator/benchmarks/measurements.h
22  PUBLIC_INCLUDES
23    public
24  PUBLIC_DEPS
25    pw_chrono.system_clock
26    pw_containers.intrusive_map
27    pw_metric
28  SOURCES
29    measurements.cc
30)
31
32pw_add_library(pw_allocator.benchmarks.benchmark STATIC
33  HEADERS
34    public/pw_allocator/benchmarks/benchmark.h
35    public/pw_allocator/benchmarks/config.h
36  PUBLIC_INCLUDES
37    public
38  PUBLIC_DEPS
39    pw_allocator.benchmarks.measurements
40    pw_allocator.block_allocator
41    pw_allocator.fragmentation
42    pw_allocator.test_harness
43    pw_chrono.system_clock
44    pw_metric
45    pw_tokenizer
46  SOURCES
47    benchmark.cc
48)
49
50# Unit tests
51
52pw_add_test(pw_allocator.benchmarks.measurements_test
53  SOURCES
54    measurements_test.cc
55  PRIVATE_DEPS
56    pw_allocator.benchmarks.measurements
57  GROUPS
58    modules
59    pw_allocator
60)
61
62pw_add_test(pw_allocator.benchmarks.benchmark_test
63  SOURCES
64    benchmark_test.cc
65  PRIVATE_DEPS
66    pw_allocator.benchmarks.benchmark
67    pw_allocator.testing
68  GROUPS
69    modules
70    pw_allocator
71)
72