1 # Copyright 2020 The Pigweed Authors
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
7 # https://www.apache.org/licenses/LICENSE-2.0
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
16 "//pw_build:pigweed.bzl",
21 package(default_visibility = ["//visibility:public"])
23 licenses(["notice"]) # Apache License 2.0
25 # TODO(pwbug/101): Need to add support for facades/backends to Bazel.
26 PW_SYNC_BINARY_SEMAPHORE_BACKEND = "//pw_sync_stl:binary_semaphore"
27 PW_SYNC_COUNTING_SEMAPHORE_BACKEND = "//pw_sync_stl:counting_semaphore"
28 PW_SYNC_MUTEX_BACKEND = "//pw_sync_stl:mutex"
29 PW_SYNC_SPIN_LOCK_BACKEND = "//pw_sync_stl:spin_lock"
32 name = "binary_semaphore_facade",
34 "public/pw_sync/binary_semaphore.h",
36 includes = ["public"],
41 PW_SYNC_BINARY_SEMAPHORE_BACKEND + "_headers",
42 "//pw_chrono:system_clock",
48 name = "binary_semaphore",
50 ":binary_semaphore_facade",
51 PW_SYNC_BINARY_SEMAPHORE_BACKEND + "_headers",
56 name = "binary_semaphore_backend",
58 PW_SYNC_BINARY_SEMAPHORE_BACKEND,
63 name = "counting_semaphore_facade",
65 "public/pw_sync/counting_semaphore.h",
67 includes = ["public"],
69 "counting_semaphore.cc"
72 PW_SYNC_COUNTING_SEMAPHORE_BACKEND + "_headers",
73 "//pw_chrono:system_clock",
79 name = "counting_semaphore",
81 ":counting_semaphore_facade",
82 PW_SYNC_COUNTING_SEMAPHORE_BACKEND + "_headers",
87 name = "counting_semaphore_backend",
89 PW_SYNC_COUNTING_SEMAPHORE_BACKEND,
94 name = "mutex_facade",
96 "public/pw_sync/mutex.h",
98 includes = ["public"],
103 PW_SYNC_MUTEX_BACKEND + "_headers",
104 "//pw_chrono:system_clock",
113 PW_SYNC_MUTEX_BACKEND + "_headers",
118 name = "mutex_backend",
120 PW_SYNC_MUTEX_BACKEND,
125 name = "spin_lock_facade",
127 "public/pw_sync/spin_lock.h",
129 includes = ["public"],
134 PW_SYNC_SPIN_LOCK_BACKEND + "_headers",
143 PW_SYNC_SPIN_LOCK_BACKEND + "_headers",
148 name = "spin_lock_backend",
150 PW_SYNC_SPIN_LOCK_BACKEND,
157 "public/pw_sync/yield_core.h",
159 includes = ["public"],
163 name = "binary_semaphore_facade_test",
165 "binary_semaphore_facade_test.cc",
166 "binary_semaphore_facade_test_c.c",
176 name = "counting_semaphore_facade_test",
178 "counting_semaphore_facade_test.cc",
179 "counting_semaphore_facade_test_c.c",
182 ":counting_semaphore",
189 name = "mutex_facade_test",
191 "mutex_facade_test.cc",
192 "mutex_facade_test_c.c",
202 name = "spin_lock_facade_test",
204 "spin_lock_facade_test.cc",
205 "spin_lock_facade_test_c.c",