mirror of
https://fuchsia.googlesource.com/third_party/pigweed.googlesource.com/pigweed/pigweed
synced 2024-09-21 14:16:26 +00:00
14f3a06a42
- Switch teensy core to 1.53 release - Add patching mechanism - Add patch to fix teensy core cpp17 compatibility. Contains these commits: - https://github.com/PaulStoffregen/cores/commit/a8046bb - https://github.com/PaulStoffregen/cores/commit/914219e - https://github.com/PaulStoffregen/cores/commit/1f3f914 - a patch to make flash_* functions non-static for teensy4 - Add delete message for downloads that fail checksums - stm32duino: Always include built-in SrcWrapper library Change-Id: Ib9e98de1bafbb81473cc7a350d8abb60a654e64f Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/27620 Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com> Reviewed-by: Keir Mierle <keir@google.com>
108 lines
3.8 KiB
Plaintext
108 lines
3.8 KiB
Plaintext
# Copyright 2020 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_arduino_build/arduino.gni")
|
|
import("$dir_pw_build/target_types.gni")
|
|
import("$dir_pw_docgen/docs.gni")
|
|
import("$dir_pw_toolchain/generate_toolchain.gni")
|
|
pw_doc_group("target_docs") {
|
|
sources = [ "target_docs.rst" ]
|
|
}
|
|
|
|
if (dir_pw_third_party_arduino != "") {
|
|
import("target_toolchains.gni")
|
|
|
|
generate_toolchains("target_toolchains") {
|
|
toolchains = pw_target_toolchain_arduino_list
|
|
}
|
|
|
|
if (current_toolchain != default_toolchain) {
|
|
config("arduino_build") {
|
|
# Debug: Print out arduinobuilder.py args
|
|
# print(string_join(" ", [rebase_path(arduino_builder_script)] + arduino_show_command_args))
|
|
|
|
# Run prebuilds
|
|
# TODO(tonymd) This only needs to be run once but it's happening multiple times.
|
|
exec_script(arduino_builder_script,
|
|
filter_exclude(arduino_run_command_args,
|
|
[ "--save-config" ]) + [ "--run-prebuilds" ],
|
|
"string")
|
|
|
|
_exclude_flags = [ "-std=gnu++14" ]
|
|
|
|
_cflags = exec_script(arduino_builder_script,
|
|
arduino_show_command_args + [ "--c-flags" ],
|
|
"list lines")
|
|
cflags = filter_exclude(_cflags, _exclude_flags)
|
|
|
|
asmflags = exec_script(arduino_builder_script,
|
|
arduino_show_command_args + [ "--s-only-flags" ],
|
|
"list lines")
|
|
|
|
_cflags_cc =
|
|
exec_script(arduino_builder_script,
|
|
arduino_show_command_args + [ "--cpp-only-flags" ],
|
|
"list lines")
|
|
cflags_cc = filter_exclude(_cflags_cc, _exclude_flags)
|
|
|
|
_ldflags = exec_script(arduino_builder_script,
|
|
arduino_show_command_args + [ "--ld-flags" ],
|
|
"list lines")
|
|
ldflags =
|
|
filter_exclude(_ldflags,
|
|
[
|
|
# Remove arguments ending in 'core.a', for example:
|
|
# C:/Users/username/pigweed/out/core.a
|
|
"*core.a\b",
|
|
|
|
# Remove .elf output file, for example:
|
|
# -o C:/Users/username/pigweed/out/pigweed.elf
|
|
"\b-o\b",
|
|
"*.elf\b",
|
|
|
|
# Remove the Arduino {object_files} variable
|
|
"{object_files}",
|
|
])
|
|
|
|
# TODO(tonymd): Determine if libs are needed.
|
|
# Teensy4 core recipe uses: '-larm_cortexM7lfsp_math -lm -lstdc++'
|
|
libs = filter_exclude(
|
|
exec_script(arduino_builder_script,
|
|
arduino_show_command_args + [ "--ld-lib-names" ],
|
|
"list lines"),
|
|
# Exclude stdc++ which causes linking errors for teensy cores.
|
|
[ "\bstdc++\b" ])
|
|
}
|
|
|
|
pw_source_set("pre_init") {
|
|
sources = [ "init.cc" ]
|
|
public_deps = [
|
|
"$dir_pw_sys_io_arduino",
|
|
"$dir_pw_third_party_arduino:arduino_core_sources",
|
|
]
|
|
deps = [
|
|
"$dir_pw_arduino_build:arduino_init.facade",
|
|
"$dir_pw_preprocessor",
|
|
]
|
|
}
|
|
}
|
|
} else {
|
|
config("arduino_build") {
|
|
}
|
|
group("pre_init") {
|
|
}
|
|
}
|