• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2022 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_docgen/docs.gni")
20import("$dir_pw_toolchain/arm_gcc/toolchains.gni")
21import("$dir_pw_toolchain/generate_toolchain.gni")
22
23if (current_toolchain != default_toolchain) {
24  pw_source_set("pico_logging_test_main") {
25    deps = [
26      "$dir_pw_log",
27      "$dir_pw_sys_io",
28      "$dir_pw_unit_test:logging_event_handler",
29      "$dir_pw_unit_test:pw_unit_test",
30    ]
31    sources = [ "pico_logging_test_main.cc" ]
32  }
33}
34
35generate_toolchain("rp2040") {
36  _excluded_members = [
37    "defaults",
38    "name",
39  ]
40  _toolchain_base = pw_toolchain_arm_gcc.cortex_m0plus_size_optimized
41  forward_variables_from(_toolchain_base, "*", _excluded_members)
42
43  # For now, no Pigweed configurations set up.
44  defaults = {
45    forward_variables_from(_toolchain_base.defaults, "*")
46
47    pw_build_EXECUTABLE_TARGET_TYPE = "pico_executable"
48    pw_build_EXECUTABLE_TARGET_TYPE_FILE =
49        get_path_info("pico_executable.gni", "abspath")
50    pw_unit_test_MAIN = "$dir_pigweed/targets/rp2040:pico_logging_test_main"
51    pw_assert_BACKEND = dir_pw_assert_basic
52    pw_log_BACKEND = dir_pw_log_basic
53    pw_sys_io_BACKEND = dir_pw_sys_io_pico
54
55    pw_sync_INTERRUPT_SPIN_LOCK_BACKEND =
56        "$dir_pw_sync_baremetal:interrupt_spin_lock"
57    pw_sync_MUTEX_BACKEND = "$dir_pw_sync_baremetal:mutex"
58    pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex"
59
60    # Silence GN variable overwrite warning.
61    pw_build_LINK_DEPS = []
62
63    pw_build_LINK_DEPS = [
64      "$dir_pw_assert:impl",
65      "$dir_pw_log:impl",
66    ]
67
68    current_cpu = "arm"
69    current_os = ""
70  }
71}
72
73pw_doc_group("target_docs") {
74  sources = [ "target_docs.rst" ]
75}
76