mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
fix: bridge nested PlatformIO async dependencies
This commit is contained in:
@@ -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")
|
||||
Reference in New Issue
Block a user