fix: bridge nested PlatformIO async dependencies

This commit is contained in:
2026-08-26 01:19:35 +10:00
parent f4fa653a7b
commit d8a78bae03
4 changed files with 34 additions and 5 deletions
+24
View File
@@ -0,0 +1,24 @@
"""Expose WiFiManager's async dependencies to PlatformIO's nested library builds."""
from __future__ import print_function
import glob
import os
from SCons.Script import Import
Import("env")
def append_dependency_include(package_prefix):
"""Add the installed package's source directory when PlatformIO has it."""
package_root = env.subst("$PROJECT_LIBDEPS_DIR")
candidates = glob.glob(os.path.join(package_root, package_prefix + "*", "src"))
if candidates:
env.Append(CPPPATH=[candidates[0]])
append_dependency_include("ESPAsyncWebServer")
if env.subst("$PIOPLATFORM") == "espressif8266":
append_dependency_include("ESPAsyncTCP")
elif env.subst("$PIOPLATFORM") == "espressif32":
append_dependency_include("AsyncTCP")