Tasmota/pio-tools/strip-floats.py

21 lines
560 B
Python
Raw Normal View History

2018-02-03 15:36:25 +00:00
Import('env')
build_flags = " ".join(env.GetProjectOption("build_flags"))
2018-02-03 15:36:25 +00:00
#
# Dump build environment (for debug)
#print env.Dump()
#
flags = " ".join(env['LINKFLAGS'])
flags = flags.replace("-u _printf_float", "")
flags = flags.replace("-u _scanf_float", "")
if "FIRMWARE_SAFEBOOT" in build_flags:
# Crash Recorder is not included in safeboot firmware -> remove Linker wrap
flags = flags.replace("-Wl,--wrap=panicHandler", "")
flags = flags.replace("-Wl,--wrap=xt_unhandled_exception", "")
2018-02-03 15:36:25 +00:00
newflags = flags.split()
env.Replace(
LINKFLAGS=newflags
)