[config] Ensure user-supplied build flags don't get silently overwritten (#7622)

This commit is contained in:
Clyde Stubbs 2024-10-22 09:49:12 +11:00 committed by Jesse Hills
parent 748256b3ee
commit c26c96b8f4
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A

View File

@ -318,6 +318,8 @@ async def add_includes(includes):
async def _add_platformio_options(pio_options): async def _add_platformio_options(pio_options):
# Add includes at the very end, so that they override everything # Add includes at the very end, so that they override everything
for key, val in pio_options.items(): for key, val in pio_options.items():
if key == "build_flags" and not isinstance(val, list):
val = [val]
cg.add_platformio_option(key, val) cg.add_platformio_option(key, val)