Skip to content

Commit 5c34e2c

Browse files
committed
kconfig: optimization levels
Add configs for optimization levels. These configs should be used by build system to properly tune compiler flags. Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
1 parent 5211799 commit 5c34e2c

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Kconfig

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,40 @@ config INTERRUPT_LEVEL_5
157157

158158
source "src/Kconfig"
159159

160+
choice
161+
prompt "Optimization"
162+
default OPTIMIZE_FOR_PERFORMANCE
163+
help
164+
Controls how compiler should optimize binary.
165+
This config should affect only compiler settings and is
166+
not meant to be used for conditional compilation of code.
167+
168+
config OPTIMIZE_FOR_PERFORMANCE
169+
bool "Optimize for performance"
170+
help
171+
Apply compiler optimizations prioritizing performance.
172+
It means -O2 for GCC or equivalent for other compilers.
173+
174+
config OPTIMIZE_FOR_SIZE
175+
bool "Optimize for size"
176+
help
177+
Apply compiler optimizations prioritizing binary size.
178+
It means -Os for GCC or equivalent for other compilers.
179+
180+
config OPTIMIZE_FOR_DEBUG
181+
bool "Optimize for debug"
182+
help
183+
Apply compiler optimizations prioritizing debugging experience.
184+
It means -Og for GCC or equivalent for other compilers.
185+
186+
config OPTIMIZE_FOR_NONE
187+
bool "Don't optimize"
188+
help
189+
Apply no compiler optimizations.
190+
It means -O0 for GCC or equivalent for other compilers.
191+
192+
endchoice
193+
160194
menu "Debug"
161195

162196
config DEBUG

0 commit comments

Comments
 (0)