• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 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)
20
21package(default_visibility = ["//visibility:public"])
22
23licenses(["notice"])  # Apache License 2.0
24
25pw_cc_library(
26    name = "id_headers",
27    hdrs = [
28        "public/pw_thread_stl/id_inline.h",
29        "public/pw_thread_stl/id_native.h",
30        "public_overrides/pw_thread_backend/id_inline.h",
31        "public_overrides/pw_thread_backend/id_native.h",
32    ],
33    includes = [
34        "public",
35        "public_overrides",
36    ],
37)
38
39pw_cc_library(
40    name = "id",
41    deps = [
42        ":id_headers",
43        "//pw_thread:id_facade",
44    ],
45)
46
47pw_cc_library(
48    name = "sleep_headers",
49    hdrs = [
50        "public/pw_thread_stl/sleep_inline.h",
51        "public_overrides/pw_thread_backend/sleep_inline.h",
52    ],
53    includes = [
54        "public",
55        "public_overrides",
56    ],
57    deps = [
58        "//pw_chrono:system_clock",
59    ],
60)
61
62pw_cc_library(
63    name = "sleep",
64    deps = [
65        ":sleep_headers",
66        "//pw_chrono:system_clock",
67        "//pw_thread:sleep_facade",
68    ],
69)
70
71pw_cc_library(
72    name = "thread_headers",
73    hdrs = [
74        "public/pw_thread_stl/options.h",
75        "public/pw_thread_stl/thread_inline.h",
76        "public/pw_thread_stl/thread_native.h",
77        "public_overrides/pw_thread_backend/thread_inline.h",
78        "public_overrides/pw_thread_backend/thread_native.h",
79    ],
80    includes = [
81        "public",
82        "public_overrides",
83    ],
84)
85
86pw_cc_library(
87    name = "thread",
88    deps = [
89        ":thread_headers",
90        "//pw_thread:thread_facade",
91    ],
92)
93
94pw_cc_library(
95    name = "test_threads",
96    deps = [
97        "//pw_thread:thread_facade",
98        "//pw_thread:test_threads_header",
99    ],
100    srcs = [
101        "test_threads.cc",
102    ]
103)
104
105pw_cc_test(
106    name = "thread_backend_test",
107    deps = [
108        "//pw_thread:thread_facade_test",
109        ":test_threads",
110    ]
111)
112
113pw_cc_library(
114    name = "yield_headers",
115    hdrs = [
116        "public/pw_thread_stl/yield_inline.h",
117        "public_overrides/pw_thread_backend/yield_inline.h",
118    ],
119    includes = [
120        "public",
121        "public_overrides",
122    ],
123)
124
125pw_cc_library(
126    name = "yield",
127    deps = [
128        ":yield_headers",
129        "//pw_thread:yield_facade",
130    ],
131)
132