From 4caac57fb5dadbc6222749a3ac5831cafb132e97 Mon Sep 17 00:00:00 2001 From: itzandroidtab Date: Sun, 24 Mar 2024 07:25:22 +0100 Subject: [PATCH] added LTO in cmakelists --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21eef57..67b7255 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,12 @@ add_executable(klib_project ${SOURCES} ${HEADERS} ) +# enable LTO +target_compile_options(klib PUBLIC "-flto") +target_compile_options(klib PUBLIC "-fuse-linker-plugin") +target_link_options(klib PUBLIC "-flto") +target_link_options(klib PUBLIC "-fuse-linker-plugin") + # set the output filename set_target_properties(klib_project PROPERTIES OUTPUT_NAME "klib" SUFFIX ".elf")