| # Copyright 2021 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("//targets/common_backends.gni") |
| |
| import("$dir_pw_protobuf_compiler/proto.gni") |
| import("$dir_pw_third_party/nanopb/nanopb.gni") |
| import("$dir_pw_toolchain/arm_gcc/toolchains.gni") |
| |
| _target_config = { |
| # Use the logging main. |
| # pw_unit_test_MAIN = "$dir_pw_unit_test:simple_printing_main" |
| |
| # Configuration options for Pigweed executable targets. |
| pw_build_EXECUTABLE_TARGET_TYPE = "pico_executable" |
| |
| pw_build_EXECUTABLE_TARGET_TYPE_FILE = |
| get_path_info("pico_executable.gni", "abspath") |
| |
| # Path to the bloaty config file for the output binaries. |
| # pw_bloat_BLOATY_CONFIG = "$dir_pw_boot_cortex_m/bloaty_config.bloaty" |
| |
| # if (pw_pico_use_test_server) { |
| # _test_runner_script = |
| # "$dir_pico_build/py/pico_build/unit_test_client.py" |
| # pw_unit_test_AUTOMATIC_RUNNER = |
| # get_path_info(_test_runner_script, "abspath") |
| # } |
| |
| # Facade backends |
| pw_assert_BACKEND = dir_pw_assert_basic |
| pw_log_BACKEND = dir_pw_log_basic |
| |
| # pw_sync_INTERRUPT_SPIN_LOCK_BACKEND = |
| # "$dir_pw_sync_baremetal:interrupt_spin_lock" |
| # pw_sync_MUTEX_BACKEND = "$dir_pw_sync_baremetal:mutex" |
| pw_sys_io_BACKEND = dir_pw_sys_io_pico |
| |
| # pw_rpc_system_server_BACKEND = |
| # "$dir_pigweed/targets/pico:system_rpc_server" |
| # pw_pico_build_INIT_BACKEND = "//targets/pico:pre_init" |
| |
| pw_build_LINK_DEPS += [ |
| "$dir_pw_assert:impl", |
| "$dir_pw_log:impl", |
| ] |
| |
| current_cpu = "arm" |
| current_os = "" |
| } |
| |
| target_toolchain_pico = { |
| _excluded_members = [ |
| "defaults", |
| "name", |
| ] |
| |
| pico_debug = { |
| name = "pico_debug" |
| _toolchain_base = pw_toolchain_arm_gcc.cortex_m0plus_size_optimized |
| forward_variables_from(_toolchain_base, "*", _excluded_members) |
| final_binary_extension = ".elf" |
| defaults = { |
| forward_variables_from(_toolchain_base.defaults, "*") |
| forward_variables_from(_target_config, "*") |
| |
| # Configure backend for pw_board_led |
| pw_board_led_BACKEND = "$dir_pw_board_led_pico" |
| |
| # Configure backend for pw_spin_delay |
| pw_spin_delay_BACKEND = "$dir_pw_spin_delay_pico" |
| } |
| } |
| |
| # # Toolchain for tests only. |
| # pico_debug_tests = { |
| # name = "pico_debug_tests" |
| # _toolchain_base = pw_target_toolchain_pico.debug |
| # forward_variables_from(_toolchain_base, "*", _excluded_members) |
| # defaults = { |
| # forward_variables_from(_toolchain_base.defaults, "*") |
| # forward_variables_from(toolchain_overrides, "*") |
| |
| # # Force tests to use basic log backend to avoid generating and loading its |
| # # own tokenized database. |
| # pw_log_BACKEND = dir_pw_log_basic |
| # } |
| # } |
| } |
| |
| toolchains_list = [ |
| target_toolchain_pico.pico_debug, |
| # target_toolchain_pico.pico_debug_tests, |
| ] |