mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 15:31:26 +12:00
Warn about LTO and adds an option to remove LTO flags
This commit is contained in:
parent
b0e5db0eb0
commit
8c01612851
1 changed files with 14 additions and 0 deletions
|
@ -123,6 +123,20 @@ add_subdirectory(3rdparty)
|
||||||
unset(CMAKE_CXX_FLAGS)
|
unset(CMAKE_CXX_FLAGS)
|
||||||
unset(CMAKE_C_FLAGS)
|
unset(CMAKE_C_FLAGS)
|
||||||
|
|
||||||
|
if (DISABLE_LTO)
|
||||||
|
if (CMAKE_C_FLAGS)
|
||||||
|
string(REGEX REPLACE "-flto[^ ]*" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
|
||||||
|
endif()
|
||||||
|
if (CMAKE_CXX_FLAGS)
|
||||||
|
string(REGEX REPLACE "-flto[^ ]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
string(FIND "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}" "-flto" FOUND_LTO)
|
||||||
|
if (NOT FOUND_LTO EQUAL -1)
|
||||||
|
message(FATAL_ERROR "Rpcs3 doesn't support building with LTO, use -DDISABLE_LTO=TRUE to force-disable it")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
add_compile_options(-pthread)
|
add_compile_options(-pthread)
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue