cmake: detect Emscripten architecture as emscripten

main
Anonymous Maarten 2023-01-30 19:13:40 +01:00 committed by Anonymous Maarten
parent 53d434fd24
commit 25b723cc82
2 changed files with 5 additions and 1 deletions

View File

@ -34,6 +34,8 @@ function(check_cpu_architecture ARCH VARIABLE)
_internal_check_cpu_architecture("defined(__aarch64__) || defined(_M_ARM64)" arm64 ${VARIABLE})
elseif(ARCH STREQUAL "loongarch64")
_internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE})
elseif(ARCH STREQUAL "emscripten")
_internal_check_cpu_architecture("defined(__EMSCRIPTEN__)" emscripten ${VARIABLE})
else()
message(WARNING "Unknown CPU architectures (${ARCH}).")
set(${VARIABLE} FALSE)

View File

@ -52,6 +52,8 @@ macro(SDL_DetectCMakePlatform)
set(SDL_CMAKE_PLATFORM Minix)
elseif(CMAKE_SYSTEM_NAME MATCHES "Android.*")
set(SDL_CMAKE_PLATFORM Android)
elseif(CMAKE_SYSTEM_NAME MATCHES "Emscripten.*")
set(SDL_CMAKE_PLATFORM Emscripten)
elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
message_error("BeOS support has been removed as of SDL 2.0.2.")
endif()
@ -76,7 +78,7 @@ function(SDL_DetectCPUArchitecture)
endforeach()
endif()
set(sdl_known_archs x86 x64 arm32 arm64 loongarch64)
set(sdl_known_archs x86 x64 arm32 arm64 loongarch64 emscripten)
if(NOT sdl_cpu_names)
set(found FALSE)
foreach(sdl_known_arch ${sdl_known_archs})