Enable LTO support for Chatterino builds (#4258)

This is disabled by default, and can be enabled by passing `-DCHATTERINO_LTO=On` to your cmake invocation.
This commit is contained in:
pajlada
2022-12-24 18:42:59 +01:00
committed by GitHub
parent 621134ffcb
commit 83dfb08aed
5 changed files with 50 additions and 4 deletions
+9
View File
@@ -20,9 +20,18 @@ option(USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
option(BUILD_WITH_QT6 "Use Qt6 instead of default Qt5" OFF)
option(CHATTERINO_GENERATE_COVERAGE "Generate coverage files" OFF)
option(BUILD_SHARED_LIBS "" OFF)
option(CHATTERINO_LTO "Enable LTO for all targets" ON)
option(USE_CONAN "Use conan" OFF)
if(CHATTERINO_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT CHATTERINO_ENABLE_LTO OUTPUT IPO_ERROR)
message(STATUS "LTO: Enabled (Supported: ${CHATTERINO_ENABLE_LTO})")
else()
message(STATUS "LTO: Disabled")
endif()
if (BUILD_WITH_QT6)
set(MAJOR_QT_VERSION "6")
else()