mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-09 14:53:19 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d14c1f13d8 |
+20
-25
@@ -322,47 +322,42 @@ endif()
|
|||||||
|
|
||||||
# Build/optimization presets
|
# Build/optimization presets
|
||||||
if (CXX_GCC OR CXX_CLANG)
|
if (CXX_GCC OR CXX_CLANG)
|
||||||
if (ARCHITECTURE_x86_64)
|
# GCC/clang will -mtune=generic by default
|
||||||
|
if ("${YUZU_BUILD_PRESET}" STREQUAL "native")
|
||||||
|
add_compile_options(
|
||||||
|
$<$<COMPILE_LANGUAGE:C,CXX>:-march=native>
|
||||||
|
$<$<COMPILE_LANGUAGE:C,CXX>:-mtune=native>)
|
||||||
|
elseif (ARCHITECTURE_x86_64)
|
||||||
# See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
|
# See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
|
||||||
# Generic supports Pentium Pro instruction set and above
|
# Generic supports Pentium Pro instruction set and above
|
||||||
# TODO: if a value is unknown, pass that as march and mtune
|
# TODO: if a value is unknown, pass that as march and mtune
|
||||||
set(YUZU_BUILD_PRESET "custom" CACHE STRING "Build preset to use. One of: custom, generic, v3, zen2, zen4, native")
|
set(YUZU_BUILD_PRESET "custom" CACHE STRING "Build preset to use. One of: custom, generic, v3, zen2, zen4, native")
|
||||||
|
|
||||||
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
|
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
|
||||||
set(march x86-64)
|
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-march=x86-64>)
|
||||||
set(mtune generic)
|
|
||||||
elseif (${YUZU_BUILD_PRESET} STREQUAL "v3")
|
elseif (${YUZU_BUILD_PRESET} STREQUAL "v3")
|
||||||
set(march x86-64-v3)
|
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-march=x86-64-v3>)
|
||||||
set(mtune generic)
|
|
||||||
elseif (${YUZU_BUILD_PRESET} STREQUAL "zen2")
|
elseif (${YUZU_BUILD_PRESET} STREQUAL "zen2")
|
||||||
set(march znver2)
|
add_compile_options(
|
||||||
set(mtune znver2)
|
$<$<COMPILE_LANGUAGE:C,CXX>:-march=znver2>
|
||||||
|
$<$<COMPILE_LANGUAGE:C,CXX>:-mtune=znver4>)
|
||||||
elseif (${YUZU_BUILD_PRESET} STREQUAL "zen4")
|
elseif (${YUZU_BUILD_PRESET} STREQUAL "zen4")
|
||||||
set(march znver4)
|
add_compile_options(
|
||||||
set(mtune znver4)
|
$<$<COMPILE_LANGUAGE:C,CXX>:-march=znver4>
|
||||||
|
$<$<COMPILE_LANGUAGE:C,CXX>:-mtune=znver4>)
|
||||||
endif()
|
endif()
|
||||||
elseif(ARCHITECTURE_arm64)
|
elseif(ARCHITECTURE_arm64)
|
||||||
# See https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html
|
# See https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html
|
||||||
set(YUZU_BUILD_PRESET "custom" CACHE STRING "Build preset to use. One of: custom, generic, optimized, armv9, native")
|
set(YUZU_BUILD_PRESET "custom" CACHE STRING "Build preset to use. One of: custom, generic, optimized, armv9, m1, native")
|
||||||
set(mtune generic)
|
|
||||||
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
|
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
|
||||||
set(march armv8-a)
|
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-march=armv8-a>)
|
||||||
elseif (${YUZU_BUILD_PRESET} STREQUAL "optimized")
|
elseif (${YUZU_BUILD_PRESET} STREQUAL "optimized")
|
||||||
set(march armv8.2-a+lse+rcpc)
|
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-march=armv8.2-a+lse+rcpc>)
|
||||||
elseif (${YUZU_BUILD_PRESET} STREQUAL "armv9")
|
elseif (${YUZU_BUILD_PRESET} STREQUAL "armv9")
|
||||||
set(march armv9-a)
|
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-march=armv9-a>)
|
||||||
|
elseif (${YUZU_BUILD_PRESET} STREQUAL "m1")
|
||||||
|
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-mcpu=apple-m1>)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if ("${YUZU_BUILD_PRESET}" STREQUAL "native")
|
|
||||||
set(march native)
|
|
||||||
set(mtune native)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (DEFINED march AND DEFINED mtune)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${march} -mtune=${mtune}")
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${march} -mtune=${mtune}")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Configure C++ standard
|
# Configure C++ standard
|
||||||
|
|||||||
Reference in New Issue
Block a user