Hello,
In my platformio, i have a root env where I have defined lib_deps for all my sub env and I want to add some libraries in few sub-env.
I have made an extrascript
Import("env")
libs=env.GetProjectOption("lib_deps")
libs.append("crankyoldgit/IRremoteESP8266@2.7.9")
print(libs)
env.Replace(lib_deps=libs)
but it doesn’t work
libs contains all the librairies but during build IRremoteESP8266 isn’t used.
I think the line "env.Replace(lib_deps=libs) is wrong !
Check out
if "USE_TINYUSB" in cpp_defines:
env.Append(CPPPATH=[os.path.join(
FRAMEWORK_DIR, "libraries", "Adafruit_TinyUSB_Arduino", "src", "arduino")])
# automatically build with lib_archive = no to make weak linking work, needed for TinyUSB
env_section = "env:" + env["PIOENV"]
platform.config.set(env_section, "lib_archive", False)
So you could try
Import("env")
platform = env.PioPlatform()
libs=env.GetProjectOption("lib_deps")
libs.append("crankyoldgit/IRremoteESP8266@2.7.9")
print(libs)
env_section = "env:" + env["PIOENV"]
platform.config.set(env_section, "lib_deps", libs)
Thank you Max,
It works very well