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_work_queue", 24 srcs = ["work_queue.cc"], 25 hdrs = [ 26 "public/pw_work_queue/work_queue.h", 27 ], 28 strip_include_prefix = "public", 29 deps = [ 30 "//pw_containers:inline_queue", 31 "//pw_function", 32 "//pw_metric:metric", 33 "//pw_status", 34 "//pw_sync:interrupt_spin_lock", 35 "//pw_sync:lock_annotations", 36 "//pw_sync:thread_notification", 37 "//pw_thread:thread", 38 ], 39) 40 41cc_library( 42 name = "test_thread_header", 43 hdrs = ["public/pw_work_queue/test_thread.h"], 44 strip_include_prefix = "public", 45) 46 47cc_library( 48 name = "work_queue_test", 49 testonly = True, 50 srcs = [ 51 "work_queue_test.cc", 52 ], 53 deps = [ 54 ":pw_work_queue", 55 ":stl_test_thread", 56 "//pw_log", 57 "//pw_unit_test", 58 ], 59) 60 61cc_library( 62 name = "stl_test_thread", 63 srcs = [ 64 "stl_test_thread.cc", 65 ], 66 target_compatible_with = incompatible_with_mcu(), 67 deps = [ 68 ":test_thread_header", 69 "//pw_thread:thread", 70 "//pw_thread_stl:thread", 71 ], 72) 73 74pw_cc_test( 75 name = "stl_work_queue_test", 76 target_compatible_with = incompatible_with_mcu(), 77 deps = [ 78 ":stl_test_thread", 79 ":work_queue_test", 80 ], 81) 82 83filegroup( 84 name = "doxygen", 85 srcs = [ 86 "public/pw_work_queue/work_queue.h", 87 ], 88) 89