blob: 65b50d407693d7d511dc087d3ada5ca5c9a76d85 [file] [log] [blame]
Armando Montanezb5d99012023-10-05 22:35:00 +00001# Copyright 2023 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/pi_pico.gni")
16import("//build_overrides/pigweed.gni")
17
18import("$dir_pw_build/target_types.gni")
19import("$dir_pw_chrono/backend.gni")
20import("$dir_pw_docgen/docs.gni")
21import("$dir_pw_unit_test/test.gni")
22
23config("public_include_path") {
24 include_dirs = [ "public" ]
25 visibility = [ ":*" ]
26}
27
28config("backend_config") {
29 include_dirs = [ "public_overrides" ]
30 visibility = [ ":*" ]
31}
32
33# This target provides the backend for pw::chrono::SystemClock.
34pw_source_set("system_clock") {
35 public_configs = [
36 ":public_include_path",
37 ":backend_config",
38 ]
39 public = [
40 "public/pw_chrono_rp2040/system_clock_config.h",
41 "public/pw_chrono_rp2040/system_clock_inline.h",
42 "public_overrides/pw_chrono_backend/system_clock_config.h",
43 "public_overrides/pw_chrono_backend/system_clock_inline.h",
44 ]
45 public_deps = [
46 "$PICO_ROOT/src/common/pico_time",
47 "$dir_pw_chrono:epoch",
48 "$dir_pw_chrono:system_clock.facade",
49 ]
50}
51
52pw_test_group("tests") {
53 tests = [ ":clock_properties_test" ]
54}
55
56pw_test("clock_properties_test") {
57 deps = [
58 "$PICO_ROOT/src/common/pico_sync",
59 "$dir_pw_chrono:system_clock",
60 ]
61 sources = [ "clock_properties_test.cc" ]
62 enable_if =
63 pw_chrono_SYSTEM_CLOCK_BACKEND == "$dir_pw_chrono_rp2040:system_clock"
64}
65
66pw_doc_group("docs") {
67 sources = [ "docs.rst" ]
68}