From 7cb3a57b9c7c75fc0313b3f79db5b5e8cc007e7d Mon Sep 17 00:00:00 2001 From: Dmitry Plotnikov Date: Thu, 4 Jul 2019 11:02:20 +0400 Subject: [PATCH] build_system: add -freorder-blocks option for release config --- CMakeLists.txt | 3 ++- make/project.mk | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b48106487..a0ef70d15f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ unset(compile_definitions) if(CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE) list(APPEND compile_options "-Os") + list(APPEND compile_options "-freorder-blocks") else() list(APPEND compile_options "-Og") endif() @@ -79,4 +80,4 @@ foreach(component_target ${build_component_targets}) add_subdirectory(${dir} ${_name}) endif() set(__idf_component_context 0) -endforeach() \ No newline at end of file +endforeach() diff --git a/make/project.mk b/make/project.mk index 32d8862e4f..e146acc42f 100644 --- a/make/project.mk +++ b/make/project.mk @@ -418,7 +418,7 @@ endif # Optimization flags are set based on menuconfig choice ifdef CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE -OPTIMIZATION_FLAGS = -Os +OPTIMIZATION_FLAGS = -Os -freorder-blocks else OPTIMIZATION_FLAGS = -Og endif