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_chrono/backend.gni")
19 import("$dir_pw_docgen/docs.gni")
20 import("$dir_pw_unit_test/test.gni")
22 config("public_include_path") {
23 include_dirs = [ "public" ]
27 pw_source_set("epoch") {
28 public = [ "public/pw_chrono/epoch.h" ]
29 public_configs = [ ":public_include_path" ]
32 pw_facade("system_clock") {
33 backend = pw_chrono_SYSTEM_CLOCK_BACKEND
34 public_configs = [ ":public_include_path" ]
36 "public/pw_chrono/internal/system_clock_macros.h",
37 "public/pw_chrono/system_clock.h",
41 "$dir_pw_preprocessor",
43 sources = [ "system_clock.cc" ]
46 # Dependency injectable implementation of pw::chrono::SystemClock::Interface.
47 pw_source_set("simulated_system_clock") {
48 public_configs = [ ":public_include_path" ]
49 public = [ "public/pw_chrono/simulated_system_clock.h" ]
52 "$dir_pw_sync:spin_lock",
56 pw_test_group("tests") {
58 ":simulated_system_clock_test",
59 ":system_clock_facade_test",
63 pw_test("simulated_system_clock_test") {
64 enable_if = pw_chrono_SYSTEM_CLOCK_BACKEND != ""
65 sources = [ "simulated_system_clock_test.cc" ]
66 deps = [ ":simulated_system_clock" ]
69 pw_test("system_clock_facade_test") {
70 enable_if = pw_chrono_SYSTEM_CLOCK_BACKEND != ""
72 "system_clock_facade_test.cc",
73 "system_clock_facade_test_c.c",
77 "$dir_pw_preprocessor",
78 pw_chrono_SYSTEM_CLOCK_BACKEND,
82 pw_doc_group("docs") {
83 sources = [ "docs.rst" ]