buildsystem: Add an option to enable LTO

This commit adds option to enable Link Time Optimization.

Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
This commit is contained in:
Radoslaw Koppel 2024-01-30 12:32:32 +01:00 committed by Carles Cufí
commit 26c8776c70
5 changed files with 28 additions and 2 deletions

View file

@ -21,6 +21,9 @@ endif()
set_compiler_property(PROPERTY optimization_speed -O2)
set_compiler_property(PROPERTY optimization_size -Os)
set_compiler_property(PROPERTY optimization_lto -flto)
set_compiler_property(PROPERTY prohibit_lto -fno-lto)
#######################################################
# This section covers flags related to warning levels #
#######################################################