xref: /aosp_15_r20/external/pigweed/pw_sync_zephyr/CMakeLists.txt (revision 61c4878ac05f98d0ceed94b57d316916de578985)
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
17pw_add_library(pw_sync_zephyr.mutex_backend INTERFACE
18  HEADERS
19    public/pw_sync_zephyr/mutex_inline.h
20    public/pw_sync_zephyr/mutex_native.h
21    public_overrides/pw_sync_backend/mutex_inline.h
22    public_overrides/pw_sync_backend/mutex_native.h
23  PUBLIC_INCLUDES
24    public
25    public_overrides
26  PUBLIC_DEPS
27    pw_sync.mutex.facade
28)
29pw_zephyrize_libraries_ifdef(
30    CONFIG_PIGWEED_SYNC_MUTEX
31    pw_sync_zephyr.mutex_backend
32)
33
34pw_add_library(pw_sync_zephyr.binary_semaphore_backend STATIC
35  HEADERS
36    public/pw_sync_zephyr/binary_semaphore_native.h
37    public/pw_sync_zephyr/binary_semaphore_inline.h
38    public_overrides/pw_sync_backend/binary_semaphore_native.h
39    public_overrides/pw_sync_backend/binary_semaphore_inline.h
40  PUBLIC_INCLUDES
41    public
42    public_overrides
43  PUBLIC_DEPS
44    pw_chrono.system_clock
45    pw_sync.binary_semaphore.facade
46  SOURCES
47    binary_semaphore.cc
48)
49pw_zephyrize_libraries_ifdef(
50    CONFIG_PIGWEED_SYNC_BINARY_SEMAPHORE
51    pw_sync_zephyr.binary_semaphore_backend
52)
53
54pw_add_library(pw_sync_zephyr.interrupt_spin_lock_backend STATIC
55  HEADERS
56    public/pw_sync_zephyr/interrupt_spin_lock_inline.h
57    public/pw_sync_zephyr/interrupt_spin_lock_native.h
58    public_overrides/pw_sync_backend/interrupt_spin_lock_inline.h
59    public_overrides/pw_sync_backend/interrupt_spin_lock_native.h
60  PUBLIC_INCLUDES
61    public
62    public_overrides
63  PUBLIC_DEPS
64    pw_sync.interrupt_spin_lock.facade
65  SOURCES
66    interrupt_spin_lock.cc
67)
68pw_zephyrize_libraries_ifdef(
69    CONFIG_PIGWEED_SYNC_INTERRUPT_SPIN_LOCK
70    pw_sync_zephyr.interrupt_spin_lock_backend
71)
72
73pw_add_library(pw_sync_zephyr.thread_notification_backend INTERFACE
74  HEADERS
75    public/pw_sync_zephyr/thread_notification_inline.h
76    public/pw_sync_zephyr/thread_notification_native.h
77    public_overrides/thread_notification/pw_sync_backend/thread_notification_inline.h
78    public_overrides/thread_notification/pw_sync_backend/thread_notification_native.h
79  PUBLIC_INCLUDES
80    public
81    public_overrides/thread_notification
82  PUBLIC_DEPS
83    pw_sync.binary_semaphore
84    pw_sync.thread_notification.facade
85)
86pw_zephyrize_libraries_ifdef(
87    CONFIG_PIGWEED_SYNC_THREAD_NOTIFICATION
88    pw_sync_zephyr.thread_notification_backend
89)
90
91pw_add_library(pw_sync_zephyr.timed_thread_notification_backend INTERFACE
92  HEADERS
93    public/pw_sync_zephyr/timed_thread_notification_inline.h
94    public_overrides/timed_thread_notification/pw_sync_backend/timed_thread_notification_inline.h
95  PUBLIC_INCLUDES
96    public
97    public_overrides/timed_thread_notification
98  PUBLIC_DEPS
99    pw_sync.binary_semaphore
100    pw_sync.timed_thread_notification.facade
101)
102
103pw_zephyrize_libraries_ifdef(
104    CONFIG_PIGWEED_SYNC_TIMED_THREAD_NOTIFICATION
105    pw_sync_zephyr.timed_thread_notification_backend
106)
107