mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 01:24:01 +02:00
cmake: add USE_LTO option
This commit is contained in:
@@ -9,6 +9,7 @@ option(APPIMAGE_UPDATER "Enables AppImage updater" OFF)
|
||||
option(DISCORD_RPC "Enables Discord Rich Presence" ON)
|
||||
option(VRU "Enables VRU support in RMG-Input" ON)
|
||||
option(USE_CCACHE "Enables usage of ccache when ccache has been found" ON)
|
||||
option(USE_LTO "Enables building with LTO/IPO when compiler supports it" ON)
|
||||
option(FORCE_XCB "Forces Qt to use the xcb platform on linux" ${LINUX})
|
||||
option(NO_RUST "Disables the building of rust subprojects" OFF)
|
||||
|
||||
@@ -32,6 +33,15 @@ if (USE_CCACHE)
|
||||
endif(CCACHE_FOUND)
|
||||
endif(USE_CCACHE)
|
||||
|
||||
if (USE_LTO)
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT ENABLE_IPO)
|
||||
|
||||
if(ENABLE_IPO)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
|
||||
endif(ENABLE_IPO)
|
||||
endif(USE_LTO)
|
||||
|
||||
if (NOT PORTABLE_INSTALL AND (WIN32 OR MSYS))
|
||||
message(WARNING "Not-Portable build not supported on windows, re-enabling PORTABLE_INSTALL!")
|
||||
set(PORTABLE_INSTALL ON)
|
||||
|
||||
@@ -5,6 +5,12 @@ project(RMG-Core)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
# RMG-Core needs LTO disabled for windows
|
||||
# else linking fails
|
||||
if (WIN32)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)
|
||||
endif(WIN32)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SDL2 REQUIRED sdl2)
|
||||
pkg_check_modules(MINIZIP REQUIRED minizip)
|
||||
|
||||
Reference in New Issue
Block a user