Fix LTO support (#4884)

Apparently the `check_ipo_supported` flag must be called after `project` is called
This commit is contained in:
pajlada
2023-10-10 13:41:09 +02:00
committed by GitHub
parent d03151d8d6
commit 63b53656b1
+10 -10
View File
@@ -29,10 +29,19 @@ option(CHATTERINO_PLUGINS "Enable EXPERIMENTAL plugin support in Chatterino" OFF
option(CHATTERINO_UPDATER "Enable update checks" ON)
mark_as_advanced(CHATTERINO_UPDATER)
if(BUILD_TESTS)
list(APPEND VCPKG_MANIFEST_FEATURES "tests")
endif()
if(BUILD_BENCHMARKS)
list(APPEND VCPKG_MANIFEST_FEATURES "benchmarks")
endif()
project(chatterino VERSION 2.4.6)
if(CHATTERINO_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT CHATTERINO_ENABLE_LTO OUTPUT IPO_ERROR)
message(STATUS "LTO: Enabled (Supported: ${CHATTERINO_ENABLE_LTO})")
message(STATUS "LTO: Enabled (Supported: ${CHATTERINO_ENABLE_LTO} - ${IPO_ERROR})")
else()
message(STATUS "LTO: Disabled")
endif()
@@ -43,15 +52,6 @@ else()
set(MAJOR_QT_VERSION "5")
endif()
if(BUILD_TESTS)
list(APPEND VCPKG_MANIFEST_FEATURES "tests")
endif()
if(BUILD_BENCHMARKS)
list(APPEND VCPKG_MANIFEST_FEATURES "benchmarks")
endif()
project(chatterino VERSION 2.4.6)
find_program(CCACHE_PROGRAM ccache)
find_program(SCCACHE_PROGRAM sccache)
if (SCCACHE_PROGRAM)