cmake: Detect powerpc architecture

main
Anonymous Maarten 2023-02-26 00:22:23 +01:00 committed by Anonymous Maarten
parent fc4085b54e
commit 3db3424b4e
3 changed files with 7 additions and 3 deletions

View File

@ -372,7 +372,7 @@ dep_option(SDL_SSE "Use SSE assembly routines" ON "SDL_ASSEMBLY;
dep_option(SDL_SSE2 "Use SSE2 assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF) dep_option(SDL_SSE2 "Use SSE2 assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
dep_option(SDL_SSE3 "Use SSE3 assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF) dep_option(SDL_SSE3 "Use SSE3 assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
dep_option(SDL_MMX "Use MMX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF) dep_option(SDL_MMX "Use MMX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF)
dep_option(SDL_ALTIVEC "Use Altivec assembly routines" ON "SDL_ASSEMBLY" OFF) dep_option(SDL_ALTIVEC "Use Altivec assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_POWERPC32 OR SDL_CPU_POWERPC64" OFF)
dep_option(SDL_ARMSIMD "Use SIMD assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF) dep_option(SDL_ARMSIMD "Use SIMD assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF)
dep_option(SDL_ARMNEON "Use NEON assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF) dep_option(SDL_ARMNEON "Use NEON assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF)
dep_option(SDL_LSX "Use LSX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF) dep_option(SDL_LSX "Use LSX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF)

View File

@ -36,9 +36,13 @@ function(check_cpu_architecture ARCH VARIABLE)
_internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE}) _internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE})
elseif(ARCH STREQUAL "emscripten") elseif(ARCH STREQUAL "emscripten")
_internal_check_cpu_architecture("defined(__EMSCRIPTEN__)" emscripten ${VARIABLE}) _internal_check_cpu_architecture("defined(__EMSCRIPTEN__)" emscripten ${VARIABLE})
elseif(ARCH STREQUAL "powerpc32")
_internal_check_cpu_architecture("defined(__PPC__) || defined(__powerpc__)" powerpc32 ${VARIABLE})
elseif(ARCH STREQUAL "powerpc64")
_internal_check_cpu_architecture("defined(__PPC64__) || defined(__powerpc64__)" powerpc64 ${VARIABLE})
else() else()
message(WARNING "Unknown CPU architectures (${ARCH}).") message(WARNING "Unknown CPU architectures (${ARCH}).")
set(${VARIABLE} FALSE) set("${VARIABLE}" FALSE)
endif() endif()
set("${VARIABLE}" "${${VARIABLE}}" PARENT_SCOPE) set("${VARIABLE}" "${${VARIABLE}}" PARENT_SCOPE)
endfunction() endfunction()

View File

@ -78,7 +78,7 @@ function(SDL_DetectCPUArchitecture)
endforeach() endforeach()
endif() endif()
set(sdl_known_archs x86 x64 arm32 arm64 loongarch64 emscripten) set(sdl_known_archs x64 x86 arm64 arm32 emscripten powerpc32 powerpc64 loongarch64)
if(NOT sdl_cpu_names) if(NOT sdl_cpu_names)
set(found FALSE) set(found FALSE)
foreach(sdl_known_arch ${sdl_known_archs}) foreach(sdl_known_arch ${sdl_known_archs})