blob: 453088aa515eadd800844db8604131ffda763d66 [file] [log] [blame]
Ewout van Bekkum04f12922021-08-05 19:34:52 -07001# 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_work_queue",
31 srcs = ["work_queue.cc"],
32 hdrs = [
33 "public/pw_work_queue/work_queue.h",
34 "public/pw_work_queue/internal/circular_buffer.h",
35 ],
36 includes = ["public"],
37 deps = [
38 "//pw_function",
39 "//pw_metric",
40 "//pw_status",
41 "//pw_sync:interrupt_spin_lock",
42 "//pw_sync:lock_annotations",
43 "//pw_sync:thread_notification",
44 "//pw_thread:thread",
45 ],
46)
47
48pw_cc_library(
49 name = "test_thread_header",
50 hdrs = ["public/pw_work_queue/test_thread.h"],
51 includes = ["public"],
52)
53
54pw_cc_library(
55 name = "work_queue_test",
56 srcs = [
57 "work_queue_test.cc",
58 ],
59 deps = [
60 "//pw_log",
61 "//pw_unit_test",
62 ":pw_work_queue",
63 ":test_thread",
64 ],
65)
66
67pw_cc_library(
68 name = "stl_test_thread",
69 srcs = [
70 "stl_test_thread.cc",
71 ],
72 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT),
73 deps = [
74 "//pw_thread:test_thread_header",
75 "//pw_thread:thread",
76 "//pw_thread_stl:thread",
77 ],
78)
79
80pw_cc_test(
81 name = "stl_work_queue_test",
82 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT),
83 deps = [
84 ":stl_test_thread",
85 ":work_queue_test",
86 ],
87)