Skip to content

Commit ac9fdef

Browse files
committed
Allow custom variants directory
1 parent e41fb08 commit ac9fdef

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Diff for: tools/platformio-build.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,20 @@
194194

195195
libs = []
196196

197+
variants_dir = join(FRAMEWORK_DIR, "variants")
198+
199+
if "build.variants_dir" in env.BoardConfig():
200+
variants_dir = join("$PROJECT_DIR", env.BoardConfig().get("build.variants_dir"))
201+
197202
if "build.variant" in env.BoardConfig():
198203
env.Append(
199204
CPPPATH=[
200-
join(FRAMEWORK_DIR, "variants",
201-
env.BoardConfig().get("build.variant"))
205+
join(variants_dir, env.BoardConfig().get("build.variant"))
202206
]
203207
)
204208
libs.append(env.BuildLibrary(
205209
join("$BUILD_DIR", "FrameworkArduinoVariant"),
206-
join(FRAMEWORK_DIR, "variants", env.BoardConfig().get("build.variant"))
210+
join(variants_dir, env.BoardConfig().get("build.variant"))
207211
))
208212

209213
envsafe = env.Clone()

0 commit comments

Comments
 (0)