mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-11-23 23:03:06 +05:00
fix: support clean SDK builds and portable C6 compiler flags
Create the SDK source directory before pioarduino populates it so its project generator supplies app_main when Arduino autostart is disabled. Skip TinyUSB setup for S2 clean targets before accessing SDK packages. Move C6 constexpr attributes into a forced include header to preserve the size optimizations across SDK metadata parsing and POSIX shell execution.
This commit is contained in:
1 parent
435b2fe1c5
commit
558d52fa9b
4 files changed
+16
-3
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Preserve C6 size optimizations through SDK metadata and shell parsing.
|
||||||
|
#define _GLIBCXX20_CONSTEXPR __attribute__((cold)) constexpr
|
||||||
|
#define _GLIBCXX23_CONSTEXPR __attribute__((cold)) constexpr
|
||||||
+2
-3
@@ -264,8 +264,7 @@ build_flags = ${esp32_defaults.build_flags}
|
|||||||
-msave-restore
|
-msave-restore
|
||||||
-fno-exceptions
|
-fno-exceptions
|
||||||
-Oz
|
-Oz
|
||||||
-D _GLIBCXX20_CONSTEXPR=__attribute__((cold))constexpr
|
-include "$PROJECT_DIR/include/c6_compiler_flags.h"
|
||||||
-D _GLIBCXX23_CONSTEXPR=__attribute__((cold))constexpr
|
|
||||||
-D USE_BLE=1
|
-D USE_BLE=1
|
||||||
-D DEFAULT_OT_IN_GPIO=15
|
-D DEFAULT_OT_IN_GPIO=15
|
||||||
-D DEFAULT_OT_OUT_GPIO=23
|
-D DEFAULT_OT_OUT_GPIO=23
|
||||||
@@ -286,7 +285,7 @@ custom_sdkconfig = ${esp32_defaults.custom_sdkconfig}
|
|||||||
'# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE is not set'
|
'# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE is not set'
|
||||||
'# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set'
|
'# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set'
|
||||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
|
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
|
||||||
; Use the compact definitions above instead of spaced native metadata.
|
; Constexpr attributes are supplied by the forced compiler header.
|
||||||
'# CONFIG_COMPILER_CXX_GLIBCXX_CONSTEXPR_COLD_CONSTEXPR is not set'
|
'# CONFIG_COMPILER_CXX_GLIBCXX_CONSTEXPR_COLD_CONSTEXPR is not set'
|
||||||
'# CONFIG_COMPILER_CXX_GLIBCXX_CONSTEXPR_COLD is not set'
|
'# CONFIG_COMPILER_CXX_GLIBCXX_CONSTEXPR_COLD is not set'
|
||||||
CONFIG_COMPILER_CXX_GLIBCXX_CONSTEXPR_NO_CHANGE=y
|
CONFIG_COMPILER_CXX_GLIBCXX_CONSTEXPR_NO_CHANGE=y
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ import re
|
|||||||
|
|
||||||
Import("env")
|
Import("env")
|
||||||
|
|
||||||
|
# HybridCompile generates app_main when the SDK source directory is empty.
|
||||||
|
dummy = Path(env.subst("$PROJECT_DIR")) / ".dummy"
|
||||||
|
dummy.mkdir(exist_ok=True)
|
||||||
|
|
||||||
build_frameworks = env.BuildFrameworks
|
build_frameworks = env.BuildFrameworks
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,13 @@ from pathlib import Path
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
from SCons.Script import Return
|
||||||
|
|
||||||
Import("env")
|
Import("env")
|
||||||
|
|
||||||
|
if env.IsCleanTarget():
|
||||||
|
Return()
|
||||||
|
|
||||||
|
|
||||||
def checkout(repository, revision, directory):
|
def checkout(repository, revision, directory):
|
||||||
if not (directory / ".git").is_dir():
|
if not (directory / ".git").is_dir():
|
||||||
|
|||||||
Reference in new issue
Block a user