mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
Fix LTO builds with Clang (#815)
This commit is contained in:
parent
d697f9e0d2
commit
1b0a24a9bd
@ -65,17 +65,19 @@ if (CMAKE_BUILD_TYPE STREQUAL Release)
|
||||
add_link_options(-s)
|
||||
endif()
|
||||
|
||||
add_link_options(-no-pie)
|
||||
|
||||
if (ENABLE_LTO)
|
||||
add_compile_options(-flto)
|
||||
add_link_options(-flto)
|
||||
|
||||
set(CMAKE_AR "gcc-ar")
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_FINISH true)
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_FINISH true)
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
set(CMAKE_AR "gcc-ar")
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_FINISH true)
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_FINISH true)
|
||||
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
set(CMAKE_AR "llvm-ar")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(BUILD_QT_SDL "Build Qt/SDL frontend" ON)
|
||||
|
Loading…
Reference in New Issue
Block a user