mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
cmake: Add new compiler optimization levels definitions
Rename and add multiple kconfig compiler options. New compiler options COMPILER_OPTIMIZATION_PERF and COMPILER_OPTIMIZATION_NONE have been added. Optimize "Debug" and "Release" options to "Default" and "Size" respectively. This commit also does the following: - The COMPILER_OPTIMIZATION_PERF option introduced multiple bug. This commit fixes those bugs. - build.yml also updated to test for the new optimization options.
This commit is contained in:
+7
-2
@@ -9,11 +9,16 @@ unset(compile_definitions)
|
||||
# Add the following build specifications here, since these seem to be dependent
|
||||
# on config values on the root Kconfig.
|
||||
|
||||
if(CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE)
|
||||
if(CONFIG_COMPILER_OPTIMIZATION_SIZE)
|
||||
list(APPEND compile_options "-Os")
|
||||
list(APPEND compile_options "-freorder-blocks")
|
||||
else()
|
||||
elseif(CONFIG_COMPILER_OPTIMIZATION_DEFAULT)
|
||||
list(APPEND compile_options "-Og")
|
||||
elseif(CONFIG_COMPILER_OPTIMIZATION_NONE)
|
||||
list(APPEND compile_options "-O0")
|
||||
elseif(CONFIG_COMPILER_OPTIMIZATION_PERF)
|
||||
list(APPEND compile_options "-O2")
|
||||
|
||||
endif()
|
||||
|
||||
if(CONFIG_COMPILER_CXX_EXCEPTIONS)
|
||||
|
||||
Reference in New Issue
Block a user