Files
espurna/code/scripts/pio_main.py
Max Prokhorov c18490cc4a PIO: pass APP_REVISION via extra scripts (#1946)
* utils/version: use git description token as version, add memoization

* pio: move extra scripts to a separate directory

* pio: add -DAPP_REVISION=... as local build flag
2019-10-16 14:41:43 +03:00

39 lines
1.1 KiB
Python

# Run this script every time building an env:
from espurna_utils import (
check_printsize,
remove_float_support,
ldscripts_inject_libpath,
lwip_inject_patcher,
app_inject_revision,
dummy_ets_printf
)
Import("env", "projenv")
# Always show warnings for project code
projenv.ProcessUnFlags("-w")
# 2.4.0 and up
remove_float_support(env)
ldscripts_inject_libpath(env)
# two-step update hint when using 1MB boards
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", check_printsize)
# disable postmortem printing to the uart. another one is in eboot, but this is what causes the most harm
if "DISABLE_POSTMORTEM_STACKDUMP" in env["CPPFLAGS"]:
env.AddPostAction(
"$BUILD_DIR/FrameworkArduino/core_esp8266_postmortem.c.o", dummy_ets_printf
)
env.AddPostAction(
"$BUILD_DIR/FrameworkArduino/core_esp8266_postmortem.cpp.o", dummy_ets_printf
)
# patch lwip1 sources conditionally:
# https://github.com/xoseperez/espurna/issues/1610
lwip_inject_patcher(env)
# when using git, add -DAPP_REVISION=(git-commit-hash)
app_inject_revision(projenv)