Allow custom variants directory

This commit is contained in:
Loick MAHIEUX 2020-11-15 16:20:02 +01:00
parent e41fb08b2a
commit ac9fdeffe4

View File

@ -194,16 +194,20 @@ if not env.BoardConfig().get("build.ldscript", ""):
libs = [] libs = []
variants_dir = join(FRAMEWORK_DIR, "variants")
if "build.variants_dir" in env.BoardConfig():
variants_dir = join("$PROJECT_DIR", env.BoardConfig().get("build.variants_dir"))
if "build.variant" in env.BoardConfig(): if "build.variant" in env.BoardConfig():
env.Append( env.Append(
CPPPATH=[ CPPPATH=[
join(FRAMEWORK_DIR, "variants", join(variants_dir, env.BoardConfig().get("build.variant"))
env.BoardConfig().get("build.variant"))
] ]
) )
libs.append(env.BuildLibrary( libs.append(env.BuildLibrary(
join("$BUILD_DIR", "FrameworkArduinoVariant"), join("$BUILD_DIR", "FrameworkArduinoVariant"),
join(FRAMEWORK_DIR, "variants", env.BoardConfig().get("build.variant")) join(variants_dir, env.BoardConfig().get("build.variant"))
)) ))
envsafe = env.Clone() envsafe = env.Clone()