Files
Max Prokhorov a4d4231ae0 PIO: remove -ota envs, handle OTA condition in extra script (#2099)
* PIO: remove -ota envs, handle OTA condition in extra script
* Tweak ESPURNA_BOARD variable
* Support git and latest in ota script
* Handle ESPURNA_FLAGS too
* Try to handle env and projenv in pylint
* Add deprecation comment about -ota envs
* regen arduino.h
2020-01-20 17:41:10 +03:00

11 lines
459 B
Python

def app_inject_flags(projenv):
# in theory, could be something different from a single cppdefine, keeping separate from flags below
board = projenv.get("ESPURNA_BOARD", "")
if board:
projenv.Append(CPPDEFINES=[board])
# only CPPDEFINES make sense here, since we should not change any others
flags = projenv.get("ESPURNA_FLAGS", "")
if flags:
projenv.MergeFlags({"CPPDEFINES": projenv.ParseFlags(flags)["CPPDEFINES"]})