aboutsummaryrefslogtreecommitdiff
path: root/pw_chrono_rp2040/BUILD.gn
diff options
context:
space:
mode:
Diffstat (limited to 'pw_chrono_rp2040/BUILD.gn')
-rw-r--r--pw_chrono_rp2040/BUILD.gn68
1 files changed, 68 insertions, 0 deletions
diff --git a/pw_chrono_rp2040/BUILD.gn b/pw_chrono_rp2040/BUILD.gn
new file mode 100644
index 000000000..65b50d407
--- /dev/null
+++ b/pw_chrono_rp2040/BUILD.gn
@@ -0,0 +1,68 @@
+# Copyright 2023 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+import("//build_overrides/pi_pico.gni")
+import("//build_overrides/pigweed.gni")
+
+import("$dir_pw_build/target_types.gni")
+import("$dir_pw_chrono/backend.gni")
+import("$dir_pw_docgen/docs.gni")
+import("$dir_pw_unit_test/test.gni")
+
+config("public_include_path") {
+ include_dirs = [ "public" ]
+ visibility = [ ":*" ]
+}
+
+config("backend_config") {
+ include_dirs = [ "public_overrides" ]
+ visibility = [ ":*" ]
+}
+
+# This target provides the backend for pw::chrono::SystemClock.
+pw_source_set("system_clock") {
+ public_configs = [
+ ":public_include_path",
+ ":backend_config",
+ ]
+ public = [
+ "public/pw_chrono_rp2040/system_clock_config.h",
+ "public/pw_chrono_rp2040/system_clock_inline.h",
+ "public_overrides/pw_chrono_backend/system_clock_config.h",
+ "public_overrides/pw_chrono_backend/system_clock_inline.h",
+ ]
+ public_deps = [
+ "$PICO_ROOT/src/common/pico_time",
+ "$dir_pw_chrono:epoch",
+ "$dir_pw_chrono:system_clock.facade",
+ ]
+}
+
+pw_test_group("tests") {
+ tests = [ ":clock_properties_test" ]
+}
+
+pw_test("clock_properties_test") {
+ deps = [
+ "$PICO_ROOT/src/common/pico_sync",
+ "$dir_pw_chrono:system_clock",
+ ]
+ sources = [ "clock_properties_test.cc" ]
+ enable_if =
+ pw_chrono_SYSTEM_CLOCK_BACKEND == "$dir_pw_chrono_rp2040:system_clock"
+}
+
+pw_doc_group("docs") {
+ sources = [ "docs.rst" ]
+}