mirror of
https://github.com/esphome/esphome.git
synced 2026-09-29 07:50:21 +00:00
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
19 lines
717 B
Plaintext
19 lines
717 B
Plaintext
# pylint: disable=E0602
|
|
Import("env") # noqa
|
|
|
|
import os
|
|
|
|
# PlatformIO pre-build script: inject lwip_override include path so our
|
|
# lwipopts.h shadows the framework's version during lwIP compilation.
|
|
#
|
|
# The arduino-pico builder uses -iprefix + -iwithprefixbefore for includes,
|
|
# which takes priority over CPPPATH (-I). We must inject our path into the
|
|
# CCFLAGS BEFORE the -iprefix flag to ensure our lwipopts.h is found first.
|
|
|
|
lwip_dir = os.path.join(env["PROJECT_DIR"], "lwip_override")
|
|
|
|
if os.path.isdir(lwip_dir):
|
|
# Insert -I<lwip_dir> at the beginning of CCFLAGS, before the framework's
|
|
# -iprefix/-iwithprefixbefore flags which would otherwise take priority.
|
|
env.Prepend(CCFLAGS=["-I", lwip_dir])
|