Skip to content
Commit f8c3e1dc authored by Lingkai Dong's avatar Lingkai Dong Committed by Devaraj Ranganna
Browse files

cmake: Set optimization level to balance code size and debug experience



The code size of `aws-iot-example` is too large to fit into the
non-secure ROM when built with the GNU toolchain, when using the default
optimization level which is `-O0`. To solve this issue, use `-Og` for
the GNU toolchain and `-O1` for ARMClang which are their respective
recommended optimization levels for reducing code size while keeping a
decent debug experience.

Also remove the setting of `CMAKE_BUILD_TYPE`, because our toolchain
script `toolchains/Modules/Platform/Generic-cortex-m-common.cmake`
clears all compiler flags that are build type specific, meaning that
which profile we set does not matter.

Signed-off-by: Lingkai Dong's avatarLingkai Dong <lingkai.dong@arm.com>
parent 756b4417
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment