• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("@rules_cc//cc:cc_library.bzl", "cc_library")
16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library")
17load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
18load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
19
20package(default_visibility = ["//visibility:public"])
21
22licenses(["notice"])
23
24cc_library(
25    name = "pw_work_queue",
26    srcs = ["work_queue.cc"],
27    hdrs = [
28        "public/pw_work_queue/work_queue.h",
29    ],
30    implementation_deps = ["//pw_assert:check"],
31    strip_include_prefix = "public",
32    deps = [
33        "//pw_containers:inline_queue",
34        "//pw_function",
35        "//pw_metric:metric",
36        "//pw_span",
37        "//pw_status",
38        "//pw_sync:interrupt_spin_lock",
39        "//pw_sync:lock_annotations",
40        "//pw_sync:thread_notification",
41        "//pw_thread:thread",
42        "//pw_thread:thread_core",
43    ],
44)
45
46cc_library(
47    name = "test_thread_header",
48    hdrs = ["public/pw_work_queue/test_thread.h"],
49    strip_include_prefix = "public",
50    deps = ["//pw_thread:thread"],
51)
52
53cc_library(
54    name = "work_queue_test",
55    testonly = True,
56    srcs = [
57        "work_queue_test.cc",
58    ],
59    deps = [
60        ":pw_work_queue",
61        ":stl_test_thread",
62        ":test_thread_header",
63        "//pw_function",
64        "//pw_log",
65        "//pw_sync:thread_notification",
66        "//pw_thread:thread",
67        "//pw_unit_test",
68    ],
69)
70
71cc_library(
72    name = "stl_test_thread",
73    srcs = [
74        "stl_test_thread.cc",
75    ],
76    target_compatible_with = incompatible_with_mcu(),
77    deps = [
78        ":test_thread_header",
79        "//pw_thread:thread",
80        "//pw_thread_stl:options",
81    ],
82)
83
84pw_cc_test(
85    name = "stl_work_queue_test",
86    target_compatible_with = incompatible_with_mcu(),
87    deps = [
88        ":stl_test_thread",
89        ":work_queue_test",
90    ],
91)
92
93filegroup(
94    name = "doxygen",
95    srcs = [
96        "public/pw_work_queue/work_queue.h",
97    ],
98)
99
100sphinx_docs_library(
101    name = "docs",
102    srcs = [
103        "docs.rst",
104    ],
105    prefix = "pw_work_queue/",
106    target_compatible_with = incompatible_with_mcu(),
107)
108