xref: /aosp_15_r20/external/pigweed/pw_metric/CMakeLists.txt (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2022 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
17pw_add_library(pw_metric STATIC
18  HEADERS
19    public/pw_metric/metric.h
20  PUBLIC_INCLUDES
21    public
22  PUBLIC_DEPS
23    pw_tokenizer.base64
24    pw_assert
25    pw_containers
26    pw_log
27    pw_tokenizer
28  SOURCES
29    metric.cc
30  PRIVATE_DEPS
31    pw_span
32)
33
34pw_add_library(pw_metric.global STATIC
35  HEADERS
36    public/pw_metric/global.h
37  PUBLIC_INCLUDES
38    public
39  PUBLIC_DEPS
40    pw_metric
41    pw_tokenizer
42  SOURCES
43    global.cc
44)
45
46pw_proto_library(pw_metric.metric_service_proto
47  SOURCES
48    pw_metric_proto/metric_service.proto
49  INPUTS
50    pw_metric_proto/metric_service.options
51    pw_metric_proto/metric_service.pwpb_options
52)
53
54pw_add_library(pw_metric.metric_walker INTERFACE
55  HEADERS
56    pw_metric_private/metric_walker.h
57  PUBLIC_DEPS
58    pw_metric
59    pw_assert
60    pw_containers
61    pw_status
62    pw_tokenizer
63)
64
65pw_add_library(pw_metric.metric_service_pwpb STATIC
66  HEADERS
67    public/pw_metric/metric_service_pwpb.h
68  PUBLIC_INCLUDES
69    public
70  PUBLIC_DEPS
71    pw_metric.metric_service_proto.pwpb_rpc
72    pw_metric.metric_service_proto.raw_rpc
73    pw_metric.metric_walker
74    pw_metric
75    pw_bytes
76    pw_containers
77    pw_rpc.raw.server_api
78  SOURCES
79    metric_service_pwpb.cc
80)
81
82pw_add_test(pw_metric.metric_test
83  SOURCES
84    metric_test.cc
85  PRIVATE_DEPS
86    pw_metric
87  GROUPS
88    modules
89    pw_metric
90)
91
92pw_add_test(pw_metric.global_test
93  SOURCES
94    global_test.cc
95  PRIVATE_DEPS
96    pw_metric.global
97  GROUPS
98    modules
99    pw_metric
100)
101