build_system: add -freorder-blocks option for release config

This commit is contained in:
Dmitry Plotnikov 2019-07-04 11:02:20 +04:00 committed by bot
parent c4e5c62cda
commit 7cb3a57b9c
2 changed files with 3 additions and 2 deletions

View file

@ -11,6 +11,7 @@ unset(compile_definitions)
if(CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE) if(CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE)
list(APPEND compile_options "-Os") list(APPEND compile_options "-Os")
list(APPEND compile_options "-freorder-blocks")
else() else()
list(APPEND compile_options "-Og") list(APPEND compile_options "-Og")
endif() endif()
@ -79,4 +80,4 @@ foreach(component_target ${build_component_targets})
add_subdirectory(${dir} ${_name}) add_subdirectory(${dir} ${_name})
endif() endif()
set(__idf_component_context 0) set(__idf_component_context 0)
endforeach() endforeach()

View file

@ -418,7 +418,7 @@ endif
# Optimization flags are set based on menuconfig choice # Optimization flags are set based on menuconfig choice
ifdef CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE ifdef CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE
OPTIMIZATION_FLAGS = -Os OPTIMIZATION_FLAGS = -Os -freorder-blocks
else else
OPTIMIZATION_FLAGS = -Og OPTIMIZATION_FLAGS = -Og
endif endif