File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments