forked from eden-emu/eden
[dynarmic, cmake] allow LTO build for dynarmic (#252)
Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: eden-emu/eden#252 Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
37e0b80766
commit
10dd003d0f
5 changed files with 9 additions and 1 deletions
|
@ -104,6 +104,7 @@ cmake .. -G Ninja \
|
|||
-DYUZU_USE_QT_WEB_ENGINE=$WEBENGINE \
|
||||
-DYUZU_USE_FASTER_LD=ON \
|
||||
-DYUZU_ENABLE_LTO=ON \
|
||||
-DDYNARMIC_ENABLE_LTO=ON \
|
||||
"${EXTRA_CMAKE_FLAGS[@]}"
|
||||
|
||||
ninja -j${NPROC}
|
||||
|
|
|
@ -52,6 +52,7 @@ cmake .. -G Ninja \
|
|||
-DYUZU_USE_QT_MULTIMEDIA=$MULTIMEDIA \
|
||||
-DYUZU_USE_QT_WEB_ENGINE=$WEBENGINE \
|
||||
-DYUZU_ENABLE_LTO=ON \
|
||||
-DDYNARMIC_ENABLE_LTO=ON \
|
||||
"${EXTRA_CMAKE_FLAGS[@]}"
|
||||
|
||||
ninja
|
||||
|
|
|
@ -179,7 +179,8 @@ android {
|
|||
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
|
||||
"-DBUILD_TESTING=OFF",
|
||||
"-DYUZU_TESTS=OFF",
|
||||
"-DDYNARMIC_TESTS=OFF"
|
||||
"-DDYNARMIC_TESTS=OFF",
|
||||
"-DDYNARMIC_ENABLE_LTO=ON"
|
||||
)
|
||||
|
||||
abiFilters("arm64-v8a")
|
||||
|
|
|
@ -23,6 +23,7 @@ option(DYNARMIC_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
|
|||
option(DYNARMIC_INSTALL "Install dynarmic headers and CMake files" OFF)
|
||||
option(DYNARMIC_USE_BUNDLED_EXTERNALS "Use all bundled externals (useful when e.g. cross-compiling)" OFF)
|
||||
option(DYNARMIC_WARNINGS_AS_ERRORS "Warnings as errors" ${MASTER_PROJECT})
|
||||
option(DYNARMIC_ENABLE_LTO "Enable LTO" OFF)
|
||||
if (NOT DEFINED DYNARMIC_FRONTENDS)
|
||||
set(DYNARMIC_FRONTENDS "A32;A64" CACHE STRING "Selects which frontends to enable")
|
||||
endif()
|
||||
|
|
|
@ -440,6 +440,10 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|||
endif()
|
||||
target_compile_definitions(dynarmic PRIVATE FMT_USE_USER_DEFINED_LITERALS=1)
|
||||
|
||||
if (DYNARMIC_ENABLE_LTO)
|
||||
set_property(TARGET dynarmic PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
endif()
|
||||
|
||||
if (DYNARMIC_USE_PRECOMPILED_HEADERS)
|
||||
set(PRECOMPILED_HEADERS "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/ir/ir_emitter.h>")
|
||||
if ("x86_64" IN_LIST ARCHITECTURE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue