blob: 09f121735360e96a6fe82c552e9a7e42bc9dbed7 [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 = [
Ewout van Bekkum04f12922021-08-05 19:34:52 -070033 "public/pw_work_queue/internal/circular_buffer.h",
Rob Mohr9e95e4b2021-08-13 09:25:51 -070034 "public/pw_work_queue/work_queue.h",
Ewout van Bekkum04f12922021-08-05 19:34:52 -070035 ],
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",
Rob Mohr9e95e4b2021-08-13 09:25:51 -070056 srcs = [
Ewout van Bekkum04f12922021-08-05 19:34:52 -070057 "work_queue_test.cc",
Rob Mohr9e95e4b2021-08-13 09:25:51 -070058 ],
Ewout van Bekkum04f12922021-08-05 19:34:52 -070059 deps = [
Ewout van Bekkum04f12922021-08-05 19:34:52 -070060 ":pw_work_queue",
61 ":test_thread",
Rob Mohr9e95e4b2021-08-13 09:25:51 -070062 "//pw_log",
63 "//pw_unit_test",
Ewout van Bekkum04f12922021-08-05 19:34:52 -070064 ],
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)