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
15 import("//build_overrides/pigweed.gni")
17 import("$dir_pw_build/target_types.gni")
18 import("$dir_pw_chrono/backend.gni")
19 import("$dir_pw_docgen/docs.gni")
21 config("public_include_path") {
22 include_dirs = [ "public" ]
26 config("backend_config") {
27 include_dirs = [ "public_overrides" ]
31 # This target provides the backend for pw::sync::BinarySemaphore.
32 pw_source_set("binary_semaphore_backend") {
34 ":public_include_path",
38 "public/pw_sync_stl/binary_semaphore_inline.h",
39 "public/pw_sync_stl/binary_semaphore_native.h",
40 "public_overrides/pw_sync_backend/binary_semaphore_inline.h",
41 "public_overrides/pw_sync_backend/binary_semaphore_native.h",
43 sources = [ "binary_semaphore.cc" ]
46 "$dir_pw_chrono:system_clock",
47 "$dir_pw_sync:binary_semaphore.facade",
50 pw_chrono_SYSTEM_CLOCK_BACKEND == "" ||
51 pw_chrono_SYSTEM_CLOCK_BACKEND == "$dir_pw_chrono_stl:system_clock",
52 "The STL pw::sync::BinarySemaphore backend only works with the " +
53 "STL pw::chrono::SystemClock backend.")
56 # This target provides the backend for pw::sync::CountingSemaphore.
57 pw_source_set("counting_semaphore_backend") {
59 ":public_include_path",
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",
68 sources = [ "counting_semaphore.cc" ]
71 "$dir_pw_chrono:system_clock",
72 "$dir_pw_sync:counting_semaphore.facade",
75 pw_chrono_SYSTEM_CLOCK_BACKEND == "" ||
76 pw_chrono_SYSTEM_CLOCK_BACKEND == "$dir_pw_chrono_stl:system_clock",
77 "The STL pw::sync::CountingSemaphore backend only works with the " +
78 "STL pw::chrono::SystemClock backend.")
81 # This target provides the backend for pw::sync::Mutex.
82 pw_source_set("mutex_backend") {
84 ":public_include_path",
88 "public/pw_sync_stl/mutex_inline.h",
89 "public/pw_sync_stl/mutex_native.h",
90 "public_overrides/pw_sync_backend/mutex_inline.h",
91 "public_overrides/pw_sync_backend/mutex_native.h",
94 "$dir_pw_chrono:system_clock",
95 "$dir_pw_sync:mutex.facade",
98 pw_chrono_SYSTEM_CLOCK_BACKEND == "" ||
99 pw_chrono_SYSTEM_CLOCK_BACKEND == "$dir_pw_chrono_stl:system_clock",
100 "The STL pw::sync::Mutex backend only works with the STL " +
101 "pw::chrono::SystemClock backend.")
104 # This target provides the backend for pw::sync::SpinLock.
105 pw_source_set("spin_lock_backend") {
107 ":public_include_path",
111 "public/pw_sync_stl/spin_lock_inline.h",
112 "public/pw_sync_stl/spin_lock_native.h",
113 "public_overrides/pw_sync_backend/spin_lock_inline.h",
114 "public_overrides/pw_sync_backend/spin_lock_native.h",
117 "$dir_pw_sync:spin_lock.facade",
118 "$dir_pw_sync:yield_core",
122 pw_doc_group("docs") {
123 sources = [ "docs.rst" ]