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")
20 import("$dir_pw_thread/backend.gni")
22 config("public_include_path") {
23 include_dirs = [ "public" ]
27 config("backend_config") {
28 include_dirs = [ "public_overrides" ]
32 # This target provides the backend for pw::thread::Id.
35 ":public_include_path",
40 "$dir_pw_interrupt:context",
41 "$dir_pw_third_party/threadx",
44 "public/pw_thread_threadx/id_inline.h",
45 "public/pw_thread_threadx/id_native.h",
46 "public_overrides/pw_thread_backend/id_inline.h",
47 "public_overrides/pw_thread_backend/id_native.h",
49 deps = [ "$dir_pw_thread:id.facade" ]
52 if (pw_chrono_SYSTEM_CLOCK_BACKEND != "" && pw_thread_SLEEP_BACKEND != "") {
53 # This target provides the backend for pw::thread::sleep_{for,until}.
54 pw_source_set("sleep") {
56 ":public_include_path",
60 "public/pw_thread_threadx/sleep_inline.h",
61 "public_overrides/pw_thread_backend/sleep_inline.h",
63 public_deps = [ "$dir_pw_chrono:system_clock" ]
64 sources = [ "sleep.cc" ]
67 "$dir_pw_chrono_threadx:system_clock",
68 "$dir_pw_third_party/threadx",
72 pw_thread_OVERRIDE_SYSTEM_CLOCK_BACKEND_CHECK ||
73 pw_chrono_SYSTEM_CLOCK_BACKEND ==
74 "$dir_pw_chrono_threadx:system_clock",
75 "The ThreadX pw::thread::sleep_{for,until} backend only works with " +
76 "the ThreadX pw::chrono::SystemClock backend.")
80 # This target provides the backend for pw::thread::yield.
81 pw_source_set("yield") {
83 ":public_include_path",
87 "public/pw_thread_threadx/yield_inline.h",
88 "public_overrides/pw_thread_backend/yield_inline.h",
92 "$dir_pw_third_party/threadx",
95 deps = [ "$dir_pw_thread:yield.facade" ]
98 pw_doc_group("docs") {
99 sources = [ "docs.rst" ]