Skip to content

Optimize (-O -O1 -O2...) with PlatformIO #1721

Answered by maxgerhardt
LazaroFilm asked this question in Q&A
Discussion options

You must be logged in to vote

PlatformIO applies a default optimization of -Os. As documented in build_flags and build_unflags, you can throw the default one out and insert your own in the platformio.ini like so:

; throw out default optimize for size
build_unflags = -Os
; let's make this slow on purpose because why not ^_^
build_flags = -O0

You can always verify that your wanted flags are applied by looking at the full compiler invocations as shown in project tasks -> Advanced -> Verbose Build.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LazaroFilm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants