Skip to content

Commit 40f4fdf

Browse files
authored
Fix PlatformIO linking for variant-specific overrides (#696)
1 parent 67b3c8f commit 40f4fdf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tools/platformio-build.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,11 @@ def configure_network_flags():
295295
os.path.join(FRAMEWORK_DIR, "variants", variant)
296296
])
297297

298-
libs.append(
299-
env.BuildLibrary(
300-
os.path.join("$BUILD_DIR", "FrameworkArduinoVariant"),
301-
os.path.join(FRAMEWORK_DIR, "variants", variant)))
298+
# link variant's source files as object files into the binary.
299+
# otherwise weak function overriding won't work in the linking stage.
300+
env.BuildSources(
301+
os.path.join("$BUILD_DIR", "FrameworkArduinoVariant"),
302+
os.path.join(FRAMEWORK_DIR, "variants", variant))
302303

303304
libs.append(
304305
env.BuildLibrary(

0 commit comments

Comments
 (0)