# 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/pigweed.gni") import("$dir_pw_chrono/backend.gni") import("$dir_pw_docgen/docs.gni") import("$dir_pw_sync/backend.gni") import("$dir_pw_thread/backend.gni") import("$dir_pw_unit_test/test.gni") config("public_include_path") { include_dirs = [ "public" ] } pw_test_group("tests") { tests = [ ":blocking_adapter_test", ":stream_test", ":uart_non_blocking_test", ":uart_test", ] } pw_source_set("uart_base") { public_configs = [ ":public_include_path" ] public = [ "public/pw_uart/uart_base.h" ] public_deps = [ "$dir_pw_status" ] } pw_source_set("uart") { public_configs = [ ":public_include_path" ] public = [ "public/pw_uart/uart.h" ] public_deps = [ ":uart_base", "$dir_pw_assert", "$dir_pw_bytes", "$dir_pw_chrono:system_clock", "$dir_pw_span", "$dir_pw_status", ] } pw_source_set("uart_non_blocking") { public_configs = [ ":public_include_path" ] public = [ "public/pw_uart/uart_non_blocking.h" ] public_deps = [ ":uart_base", "$dir_pw_assert", "$dir_pw_bytes", "$dir_pw_function", "$dir_pw_span", "$dir_pw_status", ] } pw_source_set("blocking_adapter") { public_configs = [ ":public_include_path" ] sources = [ "blocking_adapter.cc" ] public = [ "public/pw_uart/blocking_adapter.h" ] public_deps = [ ":uart", ":uart_non_blocking", "$dir_pw_assert", "$dir_pw_log", "$dir_pw_status", "$dir_pw_sync:timed_thread_notification", ] } pw_source_set("stream") { public_configs = [ ":public_include_path" ] public = [ "public/pw_uart/stream.h" ] public_deps = [ ":uart", "$dir_pw_stream", ] } pw_test("uart_test") { enable_if = pw_chrono_SYSTEM_CLOCK_BACKEND != "" sources = [ "uart_test.cc" ] deps = [ ":uart" ] } pw_test("uart_non_blocking_test") { enable_if = pw_chrono_SYSTEM_CLOCK_BACKEND != "" sources = [ "uart_non_blocking_test.cc" ] deps = [ ":uart_non_blocking" ] } pw_test("blocking_adapter_test") { enable_if = pw_sync_BINARY_SEMAPHORE_BACKEND != "" && pw_sync_MUTEX_BACKEND != "" && pw_chrono_SYSTEM_CLOCK_BACKEND != "" && pw_thread_TEST_THREAD_CONTEXT_BACKEND != "" sources = [ "blocking_adapter_test.cc" ] deps = [ ":blocking_adapter", "$dir_pw_assert", "$dir_pw_bytes", "$dir_pw_log", "$dir_pw_sync:lock_annotations", "$dir_pw_sync:mutex", "$dir_pw_sync:timed_thread_notification", "$dir_pw_thread:test_thread_context", "$dir_pw_thread:thread", "$dir_pw_unit_test", "$dir_pw_work_queue", ] } pw_test("stream_test") { enable_if = pw_chrono_SYSTEM_CLOCK_BACKEND != "" sources = [ "stream_test.cc" ] deps = [ ":stream" ] } pw_doc_group("docs") { inputs = [ "public/pw_uart/uart.h", "public/pw_uart/uart_non_blocking.h", ] sources = [ "backends.rst", "docs.rst", ] }