Skip to content

Commit 888eba5

Browse files
committed
rename + safe guard
1 parent 9a0ac78 commit 888eba5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

builder/frameworks/arduino.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,8 @@ def has_psram_config():
602602
new_build_unflags = build_unflags.split()
603603
env.Replace(BUILD_UNFLAGS=new_build_unflags)
604604

605+
if not env.get('BUILD_FLAGS'): # Initialize if not set
606+
env['BUILD_FLAGS'] = []
605607
# Check if BUILD_FLAGS contains -flto=auto
606608
build_flags = env.get('BUILD_FLAGS', [])
607609
if isinstance(build_flags, str):
@@ -933,7 +935,7 @@ def get_frameworks_in_current_env():
933935
# Handle LTO flags if flag_lto is set
934936
if flag_lto:
935937
# First remove existing -fno-lto flags, then add LTO flags
936-
component_manager.remove_lto_flags()
938+
component_manager.remove_no_lto_flags()
937939
component_manager.add_lto_flags()
938940

939941
silent_action = env.Action(component_manager.restore_pioarduino_build_py)

builder/frameworks/component_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ def print_changes_summary(self) -> None:
12721272
"""
12731273
self.logger.print_changes_summary()
12741274

1275-
def remove_lto_flags(self) -> bool:
1275+
def remove_no_lto_flags(self) -> bool:
12761276
"""
12771277
Remove all -fno-lto flags from pioarduino-build.py.
12781278

0 commit comments

Comments
 (0)