mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
Warn about LTO and adds an option to remove LTO flags
This commit is contained in:
parent
b0e5db0eb0
commit
8c01612851
@ -123,6 +123,20 @@ add_subdirectory(3rdparty)
|
||||
unset(CMAKE_CXX_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)
|
||||
add_compile_options(-pthread)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user