Use a custom setup script to check for the dependencies and pass along the required compile flags to the module; also split the object definitions for the target modules from their source so as to allow #including them.
13 lines
359 B
Python
13 lines
359 B
Python
Import('env')
|
|
|
|
|
|
usermods = env.GetProjectOption("custom_usermods","").split(" ")
|
|
# Check for dependencies
|
|
if "Temperature" in usermods:
|
|
env.Append(CPPDEFINES=[("USERMOD_DALLASTEMPERATURE")])
|
|
elif "sht" in usermods:
|
|
env.Append(CPPDEFINES=[("USERMOD_SHT")])
|
|
else:
|
|
raise RuntimeError("PWM_fan usermod requires Temperature or sht to be enabled")
|
|
|