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