1# 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) 19load( 20 "//pw_build:selects.bzl", 21 "TARGET_COMPATIBLE_WITH_HOST_SELECT", 22) 23 24package(default_visibility = ["//visibility:public"]) 25 26licenses(["notice"]) 27 28pw_cc_library( 29 name = "binary_semaphore_headers", 30 hdrs = [ 31 "public/pw_sync_stl/binary_semaphore_inline.h", 32 "public/pw_sync_stl/binary_semaphore_native.h", 33 "public_overrides/pw_sync_backend/binary_semaphore_inline.h", 34 "public_overrides/pw_sync_backend/binary_semaphore_native.h", 35 ], 36 includes = [ 37 "public", 38 "public_overrides", 39 ], 40 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 41 deps = [ 42 "//pw_chrono:system_clock", 43 ], 44) 45 46pw_cc_library( 47 name = "binary_semaphore", 48 srcs = [ 49 "binary_semaphore.cc", 50 ], 51 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 52 deps = [ 53 ":binary_semaphore_headers", 54 "//pw_assert", 55 "//pw_chrono:system_clock", 56 "//pw_sync:binary_semaphore_facade", 57 ], 58) 59 60pw_cc_library( 61 name = "counting_semaphore_headers", 62 hdrs = [ 63 "public/pw_sync_stl/counting_semaphore_inline.h", 64 "public/pw_sync_stl/counting_semaphore_native.h", 65 "public_overrides/pw_sync_backend/counting_semaphore_inline.h", 66 "public_overrides/pw_sync_backend/counting_semaphore_native.h", 67 ], 68 includes = [ 69 "public", 70 "public_overrides", 71 ], 72 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 73 deps = [ 74 "//pw_chrono:system_clock", 75 ], 76) 77 78pw_cc_library( 79 name = "counting_semaphore", 80 srcs = [ 81 "counting_semaphore.cc", 82 ], 83 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 84 deps = [ 85 ":counting_semaphore_headers", 86 "//pw_assert", 87 "//pw_chrono:system_clock", 88 "//pw_sync:counting_semaphore_facade", 89 ], 90) 91 92pw_cc_library( 93 name = "mutex_headers", 94 hdrs = [ 95 "public/pw_sync_stl/mutex_inline.h", 96 "public/pw_sync_stl/mutex_native.h", 97 "public_overrides/pw_sync_backend/mutex_inline.h", 98 "public_overrides/pw_sync_backend/mutex_native.h", 99 ], 100 includes = [ 101 "public", 102 "public_overrides", 103 ], 104 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 105 deps = ["//pw_sync:mutex_facade"], 106) 107 108pw_cc_library( 109 name = "mutex", 110 srcs = ["mutex.cc"], 111 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 112 deps = [ 113 ":mutex_headers", 114 "//pw_assert", 115 "//pw_sync:mutex_facade", 116 ], 117) 118 119pw_cc_library( 120 name = "timed_mutex_headers", 121 hdrs = [ 122 "public/pw_sync_stl/timed_mutex_inline.h", 123 "public_overrides/pw_sync_backend/timed_mutex_inline.h", 124 ], 125 includes = [ 126 "public", 127 "public_overrides", 128 ], 129 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 130 deps = [ 131 "//pw_chrono:system_clock", 132 ], 133) 134 135pw_cc_library( 136 name = "timed_mutex", 137 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 138 deps = [ 139 ":timed_mutex_headers", 140 "//pw_sync:timed_mutex_facade", 141 ], 142) 143 144pw_cc_library( 145 name = "interrupt_spin_lock_headers", 146 hdrs = [ 147 "public/pw_sync_stl/interrupt_spin_lock_inline.h", 148 "public/pw_sync_stl/interrupt_spin_lock_native.h", 149 "public_overrides/pw_sync_backend/interrupt_spin_lock_inline.h", 150 "public_overrides/pw_sync_backend/interrupt_spin_lock_native.h", 151 ], 152 includes = [ 153 "public", 154 "public_overrides", 155 ], 156 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 157 deps = [ 158 "//pw_sync:yield_core", 159 ], 160) 161 162pw_cc_library( 163 name = "interrupt_spin_lock", 164 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), 165 deps = [ 166 ":interrupt_spin_lock_headers", 167 "//pw_sync:interrupt_spin_lock_facade", 168 "//pw_sync:yield_core", 169 ], 170) 171