• 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")
18
19package(default_visibility = ["//visibility:public"])
20
21licenses(["notice"])
22
23cc_library(
24    name = "id",
25    hdrs = [
26        "id_public_overrides/pw_thread_backend/id_inline.h",
27        "id_public_overrides/pw_thread_backend/id_native.h",
28        "public/pw_thread_embos/id_inline.h",
29        "public/pw_thread_embos/id_native.h",
30    ],
31    includes = [
32        "id_public_overrides",
33        "public",
34    ],
35    target_compatible_with = [
36        "//pw_build/constraints/rtos:embos",
37    ],
38    deps = [
39        "//pw_assert:assert",
40        "//pw_thread:id.facade",
41    ],
42    # TODO: b/234876414 - This should depend on embOS but our third parties
43    # currently do not have Bazel support.
44)
45
46cc_library(
47    name = "sleep",
48    srcs = [
49        "sleep.cc",
50    ],
51    hdrs = [
52        "public/pw_thread_embos/sleep_inline.h",
53        "sleep_public_overrides/pw_thread_backend/sleep_inline.h",
54    ],
55    implementation_deps = ["//pw_assert:check"],
56    includes = [
57        "public",
58        "sleep_public_overrides",
59    ],
60    target_compatible_with = [
61        "//pw_build/constraints/rtos:embos",
62    ],
63    deps = [
64        "//pw_chrono:system_clock",
65        "//pw_thread:sleep.facade",
66    ],
67    # TODO: b/234876414 - This should depend on embOS but our third parties
68    # currently do not have Bazel support.
69)
70
71cc_library(
72    name = "thread",
73    srcs = [
74        "thread.cc",
75    ],
76    hdrs = [
77        "public/pw_thread_embos/config.h",
78        "public/pw_thread_embos/context.h",
79        "public/pw_thread_embos/options.h",
80        "public/pw_thread_embos/thread_inline.h",
81        "public/pw_thread_embos/thread_native.h",
82        "thread_public_overrides/pw_thread_backend/thread_inline.h",
83        "thread_public_overrides/pw_thread_backend/thread_native.h",
84    ],
85    implementation_deps = ["//pw_assert:check"],
86    includes = [
87        "public",
88        "thread_public_overrides",
89    ],
90    deps = [
91        ":config_override",
92        ":id",
93        "//pw_assert:assert",
94        "//pw_function",
95        "//pw_string",
96        "//pw_thread:thread.facade",
97    ],
98    # TODO: b/234876414 - This should depend on embOS but our third parties
99    # currently do not have Bazel support.
100)
101
102label_flag(
103    name = "config_override",
104    build_setting_default = "//pw_build:default_module_config",
105)
106
107cc_library(
108    name = "non_portable_test_thread_options",
109    srcs = [
110        "test_threads.cc",
111    ],
112    implementation_deps = ["//pw_assert:check"],
113    strip_include_prefix = "public",
114    # TODO: b/260637734 - This target doesn't build
115    tags = ["manual"],
116    deps = [
117        "//pw_chrono:system_clock",
118        "//pw_thread:non_portable_test_thread_options",
119        "//pw_thread:sleep",
120        "//pw_thread:thread.facade",
121    ],
122)
123
124cc_library(
125    name = "yield",
126    hdrs = [
127        "public/pw_thread_embos/yield_inline.h",
128        "yield_public_overrides/pw_thread_backend/yield_inline.h",
129    ],
130    includes = [
131        "public",
132        "yield_public_overrides",
133    ],
134    tags = ["noclangtidy"],
135    deps = [
136        "//pw_assert:assert",
137        "//pw_thread:yield.facade",
138    ],
139    # TODO: b/234876414 - This should depend on embOS but our third parties
140    # currently do not have Bazel support.
141)
142
143cc_library(
144    name = "util",
145    srcs = [
146        "util.cc",
147    ],
148    hdrs = [
149        "public/pw_thread_embos/util.h",
150    ],
151    strip_include_prefix = "public",
152    # TODO: b/260637734 - This target doesn't build
153    tags = ["manual"],
154    deps = [
155        "//pw_function",
156        "//pw_status",
157    ],
158    # TODO: b/234876414 - This should depend on embOS but our third parties
159    # currently do not have Bazel support.
160)
161
162cc_library(
163    name = "snapshot",
164    srcs = [
165        "snapshot.cc",
166    ],
167    hdrs = [
168        "public/pw_thread_embos/snapshot.h",
169    ],
170    strip_include_prefix = "public",
171    # TODO: b/260637734 - This target doesn't build
172    tags = ["manual"],
173    deps = [
174        ":util",
175        "//pw_bytes",
176        "//pw_function",
177        "//pw_log",
178        "//pw_protobuf",
179        "//pw_status",
180        "//pw_thread:snapshot",
181    ],
182    # TODO: b/234876414 - This should depend on embOS but our third parties
183    # currently do not have Bazel support.
184)
185
186sphinx_docs_library(
187    name = "docs",
188    srcs = [
189        "docs.rst",
190    ],
191    prefix = "pw_thread_embos/",
192    target_compatible_with = incompatible_with_mcu(),
193)
194