blob: 436c1a1b8dfc3c96c69cb821d4b79ad390efa68c [file] [log] [blame]
Ewout van Bekkume3b56032020-12-22 12:00:18 -08001# Copyright 2020 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
15import("//build_overrides/pigweed.gni")
16
17import("$dir_pw_build/facade.gni")
18import("$dir_pw_build/target_types.gni")
19import("$dir_pw_docgen/docs.gni")
20import("$dir_pw_unit_test/test.gni")
21import("backend.gni")
22
23config("public_include_path") {
24 include_dirs = [ "public" ]
25 visibility = [ ":*" ]
26}
27
28pw_facade("id") {
29 backend = pw_thread_ID_BACKEND
30 public_configs = [ ":public_include_path" ]
31 public = [ "public/pw_thread/id.h" ]
32}
33
34pw_facade("sleep") {
35 backend = pw_thread_SLEEP_BACKEND
36 public_configs = [ ":public_include_path" ]
37 public = [ "public/pw_thread/sleep.h" ]
38 public_deps = [
39 "$dir_pw_chrono:system_clock",
40 "$dir_pw_preprocessor",
41 ]
42 sources = [ "sleep.cc" ]
43}
44
45pw_facade("yield") {
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" ]
51}
52
53pw_test_group("tests") {
54 tests = [
55 ":id_facade_test",
56 ":sleep_facade_test",
57 ":yield_facade_test",
58 ]
59}
60
61pw_test("id_facade_test") {
62 enable_if = pw_thread_ID_BACKEND != ""
63 sources = [ "id_facade_test.cc" ]
64 deps = [ ":id" ]
65}
66
67pw_test("sleep_facade_test") {
68 enable_if = pw_thread_SLEEP_BACKEND != "" && pw_thread_ID_BACKEND != ""
69 sources = [
70 "sleep_facade_test.cc",
71 "sleep_facade_test_c.c",
72 ]
73 deps = [
74 ":id",
75 ":sleep",
76 "$dir_pw_chrono:system_clock",
77 ]
78}
79
80pw_test("yield_facade_test") {
81 enable_if = pw_thread_YIELD_BACKEND != "" && pw_thread_ID_BACKEND != ""
82 sources = [
83 "yield_facade_test.cc",
84 "yield_facade_test_c.c",
85 ]
86 deps = [
87 ":id",
88 ":yield",
89 ]
90}
91
92pw_doc_group("docs") {
93 sources = [ "docs.rst" ]
94}