mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-01-31 01:15:17 +01:00
CMakeLists: Use CMAKE_INTERPROCEDURAL_OPTIMIZATION for LTO
Just a simple modernization. LTO is still disabled by default.
This commit is contained in:
@@ -377,15 +377,13 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_LTO)
|
if(ENABLE_LTO)
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
include(CheckIPOSupported)
|
||||||
add_compile_options(/GL)
|
check_ipo_supported(RESULT supported OUTPUT error)
|
||||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " /LTCG")
|
|
||||||
|
if(supported)
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||||
else()
|
else()
|
||||||
check_and_add_flag(LTO -flto)
|
message(STATUS "IPO / LTO not supported: <${error}>")
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
|
||||||
set(CMAKE_AR gcc-ar)
|
|
||||||
set(CMAKE_RANLIB gcc-ranlib)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user