From 975e571a6f440adee7a870f7faa4405886ec641f Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:05:47 +0200 Subject: [PATCH] Update CMakeLists.txt --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1f67cdc052..67ccda9e208 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,7 +204,7 @@ endif() if(CONFIG_COMPILER_ENABLE_LTO) set(CMAKE_AR ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar) set(CMAKE_RANLIB ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib) - list(APPEND compile_options "-flto=auto" + list(APPEND compile_options "-flto=auto" "-ffat-lto-objects" "-flto-compression-level=9") list(APPEND link_options "-flto" @@ -212,6 +212,7 @@ if(CONFIG_COMPILER_ENABLE_LTO) "-ffat-lto-objects" "-flto-partition=max") else() + list(APPEND compile_options "-fno-lto") list(APPEND link_options "-fno-lto") endif()