xref: /aosp_15_r20/external/pigweed/pw_multisink/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2021 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
15load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
16load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
17
18package(default_visibility = ["//visibility:public"])
19
20licenses(["notice"])
21
22cc_library(
23    name = "pw_multisink",
24    srcs = [
25        "multisink.cc",
26    ],
27    hdrs = [
28        "public/pw_multisink/config.h",
29        "public/pw_multisink/multisink.h",
30    ],
31    strip_include_prefix = "public",
32    deps = [
33        ":config_override",
34        "//pw_assert",
35        "//pw_bytes",
36        "//pw_containers",
37        "//pw_function",
38        "//pw_log",
39        "//pw_result",
40        "//pw_ring_buffer",
41        "//pw_sync:interrupt_spin_lock",
42        "//pw_sync:lock_annotations",
43        "//pw_sync:mutex",
44        "//pw_varint",
45    ],
46)
47
48label_flag(
49    name = "config_override",
50    build_setting_default = "//pw_build:default_module_config",
51)
52
53cc_library(
54    name = "util",
55    srcs = ["util.cc"],
56    hdrs = ["public/pw_multisink/util.h"],
57    strip_include_prefix = "public",
58    deps = [
59        ":pw_multisink",
60        "//pw_bytes",
61        "//pw_function",
62        "//pw_log",
63        "//pw_log:log_proto_pwpb",
64        "//pw_status",
65    ],
66)
67
68cc_library(
69    name = "test_thread",
70    hdrs = ["public/pw_multisink/test_thread.h"],
71    strip_include_prefix = "public",
72    deps = [
73        "//pw_thread:thread",
74    ],
75)
76
77pw_cc_test(
78    name = "multisink_test",
79    srcs = [
80        "multisink_test.cc",
81    ],
82    deps = [
83        ":pw_multisink",
84        "//pw_function",
85        "//pw_preprocessor",
86        "//pw_status",
87        "//pw_unit_test",
88    ],
89)
90
91cc_library(
92    name = "multisink_threaded_test",
93    testonly = True,
94    srcs = [
95        "multisink_threaded_test.cc",
96    ],
97    deps = [
98        ":pw_multisink",
99        ":test_thread",
100        "//pw_string",
101        "//pw_thread:thread",
102        "//pw_thread:yield",
103        "//pw_unit_test",
104    ],
105)
106
107cc_library(
108    name = "stl_test_thread",
109    srcs = [
110        "stl_test_thread.cc",
111    ],
112    target_compatible_with = incompatible_with_mcu(),
113    deps = [
114        ":test_thread",
115        "//pw_thread:thread",
116        "//pw_thread_stl:thread",
117    ],
118)
119
120pw_cc_test(
121    name = "stl_multisink_threaded_test",
122    target_compatible_with = incompatible_with_mcu(),
123    deps = [
124        ":multisink_threaded_test",
125        ":stl_test_thread",
126    ],
127)
128