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