mirror of
https://github.com/wled/WLED.git
synced 2025-07-05 09:56:32 +00:00

Check the safest possible location for final information on what components are actually being linked in. This demonstrates a safe approach that works even for out-of-tree modules.
13 lines
489 B
Python
13 lines
489 B
Python
from platformio.package.meta import PackageSpec
|
|
Import('env')
|
|
|
|
|
|
libs = [PackageSpec(lib).name for lib in env.GetProjectOption("lib_deps",[])]
|
|
# Check for dependencies
|
|
if "Temperature" in libs:
|
|
env.Append(CPPDEFINES=[("USERMOD_DALLASTEMPERATURE")])
|
|
elif "sht" in libs:
|
|
env.Append(CPPDEFINES=[("USERMOD_SHT")])
|
|
elif "PWM_fan" in libs: # The script can be run if this module was previously selected
|
|
raise RuntimeError("PWM_fan usermod requires Temperature or sht to be enabled")
|