mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-01-30 19:13:09 +00:00
Merge pull request #14299 from SuperSamus/cmake-ipo-modern
CMakeLists: Use `CMAKE_INTERPROCEDURAL_OPTIMIZATION` for LTO
This commit is contained in:
commit
74ff1f76c5
@ -377,15 +377,13 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
endif()
|
||||
|
||||
if(ENABLE_LTO)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||
add_compile_options(/GL)
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " /LTCG")
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT supported OUTPUT error)
|
||||
|
||||
if(supported)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
else()
|
||||
check_and_add_flag(LTO -flto)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
||||
set(CMAKE_AR gcc-ar)
|
||||
set(CMAKE_RANLIB gcc-ranlib)
|
||||
endif()
|
||||
message(STATUS "IPO / LTO not supported: <${error}>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user