[core] Specify toolchain prefix in board.json

This commit is contained in:
Kuba Szczodrzyński
2022-06-26 16:04:49 +02:00
parent 582eed3be8
commit accf37de39
5 changed files with 21 additions and 19 deletions

View File

@@ -1,2 +0,0 @@
realtek-ambz Realtek AmebaZ Arduino Core
libretuya Interfaces for LibreTuya Arduino cores

View File

@@ -1,6 +1,7 @@
{
"build": {
"f_cpu": "120000000L"
"f_cpu": "120000000L",
"prefix": "arm-none-eabi-"
},
"connectivity": [
"wifi",

View File

@@ -2,6 +2,7 @@
"build": {
"family": "RTL8710B",
"f_cpu": "125000000L",
"prefix": "arm-none-eabi-",
"amb_flash_addr": "0x08000000"
},
"connectivity": [

View File

@@ -28,18 +28,19 @@ if env.get("PROGNAME", "program") == "program":
env.Replace(PROGSUFFIX=".elf")
# Toolchain config - TODO multiple arch, specified in board.json
prefix = board.get("build.prefix", "")
env.Replace(
AR="arm-none-eabi-gcc-ar",
AS="arm-none-eabi-gcc",
CC="arm-none-eabi-gcc",
CXX="arm-none-eabi-g++",
GDB="arm-none-eabi-gdb",
NM="arm-none-eabi-gcc-nm",
LINK="arm-none-eabi-gcc",
OBJCOPY="arm-none-eabi-objcopy",
OBJDUMP="arm-none-eabi-objdump",
# RANLIB="arm-none-eabi-gcc-ranlib",
SIZETOOL="arm-none-eabi-size",
AR=prefix + "gcc-ar",
AS=prefix + "gcc",
CC=prefix + "gcc",
CXX=prefix + "g++",
GDB=prefix + "gdb",
NM=prefix + "gcc-nm",
LINK=prefix + "gcc",
OBJCOPY=prefix + "objcopy",
OBJDUMP=prefix + "objdump",
# RANLIB=prefix + "gcc-ranlib",
SIZETOOL=prefix + "size",
)
# Default environment options

View File

@@ -54,11 +54,12 @@ def env_add_library(
srcs.append("-<" + expr + ">")
# queue library for further env clone and build
env.Prepend(
LIBQUEUE=[
(join("$BUILD_DIR", name), base_dir, srcs, options),
]
)
if srcs:
env.Prepend(
LIBQUEUE=[
(join("$BUILD_DIR", name), base_dir, srcs, options),
]
)
# search all include paths
for dir, expr in iter_expressions(includes):