From 7df2af70b994abc56f9178128e5d7549f04b712b Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Wed, 16 Oct 2024 10:43:18 +0200 Subject: CMake: Change -flto to -flto=auto to speed up linking And suppress a related warning: lto-wrapper: warning: using serial compilation of LTRANS jobs --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16e251c..5d550f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,10 +72,10 @@ include_directories(include) # FIXME this is currently broken #set(CMAKE_CXX_VISIBILITY_PRESET hidden) # General purpose build flags. -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -fstack-protector -fno-strict-aliasing -flto") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -fstack-protector -fno-strict-aliasing -flto=auto") # Enable link time optimization, and track function and data sections. We let # the linker remove unused code. -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -ffunction-sections -fdata-sections -Wl,--gc-sections") +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=auto -ffunction-sections -fdata-sections -Wl,--gc-sections") # Next, add warnings #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") # Add debug information -- cgit v1.2.3-70-g09d2