mirror of
https://github.com/patchzyy/wiicompiled
synced 2026-09-11 17:31:29 -04:00
add native aarch64 (arm64) support
use -mcpu=native on arm64 targets build-appimage.sh kernel architecture detection
This commit is contained in:
@@ -298,11 +298,26 @@ else()
|
||||
message(STATUS "RetroRewind target disabled (run translate-mod and emit-build-shards)")
|
||||
endif()
|
||||
|
||||
# x86-64-v3 (SSE3/SSSE3/SSE4.1/FMA/AVX2/BMI2) is the baseline runtime/src/host_cpu_baseline.cpp
|
||||
# guards against - a fixed, portable floor since an x86_64 build may run on a different machine
|
||||
# than the one that built it. AArch64 has no such redistribution path here: every build this
|
||||
# project produces runs only on the machine that built it (local-build.sh, and the AppImage which
|
||||
# wraps it, always build from source on the target), so -mcpu=native is safe and strictly better -
|
||||
# real per-core tuning (scheduling, whatever NEON/atomic extensions that exact CPU actually has)
|
||||
# instead of the generic armv8-a baseline Clang would otherwise assume.
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(AMD64|amd64|x86_64|X86_64)$")
|
||||
set(MKW_BASELINE_ARCH_FLAG -march=x86-64-v3)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|ARM64)$")
|
||||
set(MKW_BASELINE_ARCH_FLAG -mcpu=native)
|
||||
else()
|
||||
set(MKW_BASELINE_ARCH_FLAG "")
|
||||
endif()
|
||||
|
||||
set(MKW_ALL_BUILD_TARGETS
|
||||
mkw_runtime_common mkw_base_shared mkw_base_sensitive mkw_retro_sensitive
|
||||
mkw_retro_rewind_functions WiiCompiled RetroRewind)
|
||||
foreach(target IN LISTS MKW_ALL_BUILD_TARGETS)
|
||||
if(TARGET ${target})
|
||||
target_compile_options(${target} PRIVATE -march=x86-64-v3)
|
||||
if(TARGET ${target} AND MKW_BASELINE_ARCH_FLAG)
|
||||
target_compile_options(${target} PRIVATE ${MKW_BASELINE_ARCH_FLAG})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
Reference in New Issue
Block a user