• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
16
17if(CONFIG_PIGWEED_SYNC_MUTEX)
18  pw_add_library(pw_sync_zephyr.mutex_backend INTERFACE
19    HEADERS
20      public/pw_sync_zephyr/mutex_inline.h
21      public/pw_sync_zephyr/mutex_native.h
22      public_overrides/pw_sync_backend/mutex_inline.h
23      public_overrides/pw_sync_backend/mutex_native.h
24    PUBLIC_INCLUDES
25      public
26      public_overrides
27    PUBLIC_DEPS
28      pw_sync.mutex.facade
29  )
30  zephyr_link_libraries(pw_sync_zephyr.mutex_backend)
31  zephyr_link_interface(pw_sync_zephyr.mutex_backend)
32endif()
33
34if(CONFIG_PIGWEED_SYNC_BINARY_SEMAPHORE)
35  pw_add_library(pw_sync_zephyr.binary_semaphore_backend STATIC
36    HEADERS
37      public/pw_sync_zephyr/binary_semaphore_native.h
38      public/pw_sync_zephyr/binary_semaphore_inline.h
39      public_overrides/pw_sync_backend/binary_semaphore_native.h
40      public_overrides/pw_sync_backend/binary_semaphore_inline.h
41    PUBLIC_INCLUDES
42      public
43      public_overrides
44    PUBLIC_DEPS
45      pw_chrono.system_clock
46      pw_sync.binary_semaphore.facade
47    SOURCES
48      binary_semaphore.cc
49  )
50  zephyr_link_libraries(pw_sync_zephyr.binary_semaphore_backend)
51  zephyr_link_interface(pw_sync_zephyr.binary_semaphore_backend)
52endif()
53