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( 16 "//pw_build:pigweed.bzl", 17 "pw_cc_library", 18 "pw_cc_test", 19) 20load( 21 "//pw_build:selects.bzl", 22 "TARGET_COMPATIBLE_WITH_HOST_SELECT", 23) 24 25package(default_visibility = ["//visibility:public"]) 26 27licenses(["notice"]) 28 29pw_cc_library( 30 name = "pw_multisink", 31 srcs = [ 32 "multisink.cc", 33 ], 34 hdrs = [ 35 "public/pw_multisink/config.h", 36 "public/pw_multisink/multisink.h", 37 ], 38 includes = ["public"], 39 deps = [ 40 "//pw_assert", 41 "//pw_bytes", 42 "//pw_containers", 43 "//pw_function", 44 "//pw_log", 45 "//pw_result", 46 "//pw_ring_buffer", 47 "//pw_sync:interrupt_spin_lock", 48 "//pw_sync:lock_annotations", 49 "//pw_sync:mutex", 50 "//pw_varint", 51 ], 52) 53 54pw_cc_library( 55 name = "util", 56 srcs = ["util.cc"], 57 hdrs = ["public/pw_multisink/util.h"], 58 includes = ["public"], 59 deps = [ 60 ":pw_multisink", 61 "//pw_bytes", 62 "//pw_function", 63 "//pw_log", 64 "//pw_log:log_proto_cc.pwpb", 65 "//pw_status", 66 ], 67) 68 69pw_cc_library( 70 name = "test_thread", 71 hdrs = ["public/pw_multisink/test_thread.h"], 72 includes = ["public"], 73 deps = [ 74 "//pw_thread:thread", 75 ], 76) 77 78pw_cc_test( 79 name = "multisink_test", 80 srcs = [ 81 "multisink_test.cc", 82 ], 83 deps = [ 84 ":pw_multisink", 85 "//pw_function", 86 "//pw_preprocessor", 87 "//pw_status", 88 "//pw_unit_test", 89 ], 90) 91 92pw_cc_library( 93 name = "multisink_threaded_test", 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 107pw_cc_library( 108 name = "stl_test_thread", 109 srcs = [ 110 "stl_test_thread.cc", 111 ], 112 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 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 = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 123 deps = [ 124 ":multisink_threaded_test", 125 ":stl_test_thread", 126 ], 127) 128