blob: ceb60c69af2e8be7c5f3e204029e7012f9085d35 [file] [log] [blame]
Ewout van Bekkum58901932020-11-09 12:46:52 -08001# Copyright 2020 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"]) # Apache License 2.0
24
25# TODO(pwbug/101): Need to add support for facades/backends to Bazel.
26PW_SYNC_SPIN_LOCK_BACKEND = "//pw_sync_stl:spin_lock"
27
28pw_cc_library(
29 name = "spin_lock_facade",
30 hdrs = [
31 "public/pw_sync/spin_lock.h",
32 ],
33 includes = ["public"],
34 srcs = [
35 "spin_lock.cc"
36 ],
37 deps = [
38 PW_SYNC_SPIN_LOCK_BACKEND + "_headers",
39 "//pw_preprocessor",
40 ],
41)
42
43pw_cc_library(
44 name = "spin_lock",
45 deps = [
46 ":spin_lock_facade",
47 PW_SYNC_SPIN_LOCK_BACKEND + "_headers",
48 ],
49)
50
51pw_cc_library(
52 name = "spin_lock_backend",
53 deps = [
54 PW_SYNC_SPIN_LOCK_BACKEND,
55 ],
56)
57
58pw_cc_library(
59 name = "yield_core",
60 hdrs = [
61 "public/pw_sync/yield_core.h",
62 ],
63 includes = ["public"],
64)
65
66pw_cc_test(
67 name = "spin_lock_facade_test",
68 srcs = [
69 "spin_lock_facade_test.cc",
70 "spin_lock_facade_test_c.c",
71 ],
72 deps = [
73 ":spin_lock",
74 "//pw_preprocessor",
75 "//pw_unit_test",
76 ],
77)