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( 16 "//pw_build:pigweed.bzl", 17 "pw_cc_library", 18 "pw_cc_test", 19) 20 21package(default_visibility = ["//visibility:public"]) 22 23licenses(["notice"]) 24 25pw_cc_library( 26 name = "id_headers", 27 hdrs = [ 28 "id_public_overrides/pw_thread_backend/id_inline.h", 29 "id_public_overrides/pw_thread_backend/id_native.h", 30 "public/pw_thread_threadx/id_inline.h", 31 "public/pw_thread_threadx/id_native.h", 32 ], 33 includes = [ 34 "id_public_overrides", 35 "public", 36 ], 37) 38 39pw_cc_library( 40 name = "id", 41 deps = [ 42 ":id_headers", 43 "//pw_thread:id_facade", 44 ], 45 # TODO(b/234876414): This should depend on ThreadX but our third parties 46 # currently do not have Bazel support. 47) 48 49# This target provides the ThreadX specific headers needs for thread creation. 50pw_cc_library( 51 name = "thread_headers", 52 hdrs = [ 53 "public/pw_thread_threadx/config.h", 54 "public/pw_thread_threadx/context.h", 55 "public/pw_thread_threadx/options.h", 56 "public/pw_thread_threadx/thread_inline.h", 57 "public/pw_thread_threadx/thread_native.h", 58 "thread_public_overrides/pw_thread_backend/thread_inline.h", 59 "thread_public_overrides/pw_thread_backend/thread_native.h", 60 ], 61 includes = [ 62 "public", 63 "thread_public_overrides", 64 ], 65 # TODO(b/257321712): This target doesn't build. 66 tags = ["manual"], 67 deps = [ 68 ":id", 69 "//pw_assert", 70 "//pw_string", 71 "//pw_thread:thread_facade", 72 ], 73 # TODO(b/234876414): This should depend on ThreadX but our third parties 74 # currently do not have Bazel support. 75) 76 77pw_cc_library( 78 name = "thread", 79 srcs = [ 80 "thread.cc", 81 ], 82 # TODO(b/257321712): This target doesn't build. 83 tags = ["manual"], 84 deps = [ 85 ":id", 86 ":thread_headers", 87 "//pw_assert", 88 ], 89) 90 91pw_cc_library( 92 name = "test_threads", 93 srcs = [ 94 "test_threads.cc", 95 ], 96 # TODO(b/257321712): This target doesn't build. 97 tags = ["manual"], 98 deps = [ 99 "//pw_chrono:system_clock", 100 "//pw_thread:sleep", 101 "//pw_thread:test_threads_header", 102 "//pw_thread:thread_facade", 103 ], 104) 105 106pw_cc_test( 107 name = "thread_backend_test", 108 # TODO(b/257321712): This target doesn't build. 109 tags = ["manual"], 110 deps = [ 111 ":test_threads", 112 "//pw_thread:thread_facade_test", 113 ], 114) 115 116pw_cc_library( 117 name = "sleep_headers", 118 hdrs = [ 119 "public/pw_thread_threadx/sleep_inline.h", 120 "sleep_public_overrides/pw_thread_backend/sleep_inline.h", 121 ], 122 includes = [ 123 "public", 124 "sleep_public_overrides", 125 ], 126 deps = [ 127 "//pw_chrono:system_clock", 128 ], 129) 130 131pw_cc_library( 132 name = "sleep", 133 srcs = [ 134 "sleep.cc", 135 ], 136 # TODO(b/257321712): This target doesn't build. 137 tags = ["manual"], 138 deps = [ 139 ":sleep_headers", 140 "//pw_assert", 141 "//pw_chrono:system_clock", 142 "//pw_chrono_threadx:system_clock_headers", 143 "//pw_thread:sleep_facade", 144 ], 145) 146 147pw_cc_library( 148 name = "yield_headers", 149 hdrs = [ 150 "public/pw_thread_threadx/yield_inline.h", 151 "yield_public_overrides/pw_thread_backend/yield_inline.h", 152 ], 153 includes = [ 154 "public", 155 "yield_public_overrides", 156 ], 157 # TODO(b/257321712): This target doesn't build. 158 tags = ["manual"], 159) 160 161pw_cc_library( 162 name = "yield", 163 deps = [ 164 ":yield_headers", 165 "//pw_thread:yield_facade", 166 ], 167) 168 169pw_cc_library( 170 name = "util", 171 srcs = [ 172 "util.cc", 173 ], 174 hdrs = [ 175 "public/pw_thread_threadx/util.h", 176 ], 177 includes = ["public"], 178 # TODO(b/257321712): This target doesn't build. 179 tags = ["manual"], 180 deps = [ 181 "//pw_function", 182 "//pw_status", 183 ], 184) 185 186pw_cc_library( 187 name = "snapshot", 188 srcs = [ 189 "snapshot.cc", 190 ], 191 hdrs = [ 192 "public/pw_thread_threadx/snapshot.h", 193 ], 194 # TODO(b/257321712): This target doesn't build. 195 tags = ["manual"], 196 deps = [ 197 ":util", 198 "//pw_bytes", 199 "//pw_function", 200 "//pw_log", 201 "//pw_protobuf", 202 "//pw_status", 203 "//pw_thread:thread_cc.pwpb", 204 ], 205) 206