| # Copyright 2022 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_docgen/docs.gni") |
| import("$dir_pw_toolchain/arm_gcc/toolchains.gni") |
| import("$dir_pw_toolchain/generate_toolchain.gni") |
| |
| if (current_toolchain != default_toolchain) { |
| pw_source_set("pico_logging_test_main") { |
| # Required because the pico SDK can't properly propagate -Wno-undef and |
| # -Wno-unused-function because of Pigweed's very unusual default_configs |
| # behavior. |
| remove_configs = [ "$dir_pw_build:strict_warnings" ] |
| deps = [ |
| "$PICO_ROOT/src/common/pico_base", |
| "$PICO_ROOT/src/common/pico_stdlib", |
| "$dir_pw_unit_test:logging_event_handler", |
| "$dir_pw_unit_test:pw_unit_test", |
| ] |
| sources = [ "pico_logging_test_main.cc" ] |
| } |
| } |
| |
| generate_toolchain("rp2040") { |
| _excluded_members = [ |
| "defaults", |
| "name", |
| ] |
| _toolchain_base = pw_toolchain_arm_gcc.cortex_m0plus_size_optimized |
| forward_variables_from(_toolchain_base, "*", _excluded_members) |
| |
| # For now, no Pigweed configurations set up. |
| defaults = { |
| forward_variables_from(_toolchain_base.defaults, "*") |
| |
| pw_build_EXECUTABLE_TARGET_TYPE = "pico_executable" |
| pw_build_EXECUTABLE_TARGET_TYPE_FILE = |
| get_path_info("pico_executable.gni", "abspath") |
| pw_unit_test_MAIN = "$dir_pigweed/targets/rp2040:pico_logging_test_main" |
| pw_assert_BACKEND = dir_pw_assert_basic |
| pw_log_BACKEND = dir_pw_log_basic |
| pw_sys_io_BACKEND = "$dir_pw_sys_io_stdio" |
| |
| pw_sync_INTERRUPT_SPIN_LOCK_BACKEND = |
| "$dir_pw_sync_baremetal:interrupt_spin_lock" |
| pw_sync_MUTEX_BACKEND = "$dir_pw_sync_baremetal:mutex" |
| |
| # Silence GN variable overwrite warning. |
| pw_build_LINK_DEPS = [] |
| |
| pw_build_LINK_DEPS = [ |
| "$dir_pw_assert:impl", |
| "$dir_pw_log:impl", |
| ] |
| |
| current_cpu = "arm" |
| current_os = "" |
| } |
| } |
| |
| pw_doc_group("target_docs") { |
| sources = [ "target_docs.rst" ] |
| } |