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/facade.gni")
18 import("$dir_pw_build/target_types.gni")
19 import("$dir_pw_docgen/docs.gni")
20 import("$dir_pw_unit_test/test.gni")
23 config("public_include_path") {
24 include_dirs = [ "public" ]
29 backend = pw_thread_ID_BACKEND
30 public_configs = [ ":public_include_path" ]
31 public = [ "public/pw_thread/id.h" ]
35 backend = pw_thread_SLEEP_BACKEND
36 public_configs = [ ":public_include_path" ]
37 public = [ "public/pw_thread/sleep.h" ]
39 "$dir_pw_chrono:system_clock",
40 "$dir_pw_preprocessor",
42 sources = [ "sleep.cc" ]
46 backend = pw_thread_YIELD_BACKEND
47 public_configs = [ ":public_include_path" ]
48 public = [ "public/pw_thread/yield.h" ]
49 public_deps = [ "$dir_pw_preprocessor" ]
50 sources = [ "yield.cc" ]
53 pw_test_group("tests") {
61 pw_test("id_facade_test") {
62 enable_if = pw_thread_ID_BACKEND != ""
63 sources = [ "id_facade_test.cc" ]
67 pw_test("sleep_facade_test") {
68 enable_if = pw_thread_SLEEP_BACKEND != "" && pw_thread_ID_BACKEND != ""
70 "sleep_facade_test.cc",
71 "sleep_facade_test_c.c",
76 "$dir_pw_chrono:system_clock",
80 pw_test("yield_facade_test") {
81 enable_if = pw_thread_YIELD_BACKEND != "" && pw_thread_ID_BACKEND != ""
83 "yield_facade_test.cc",
84 "yield_facade_test_c.c",
92 pw_doc_group("docs") {
93 sources = [ "docs.rst" ]