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