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}) _internal_check_cpu_architecture("defined(__aarch64__) || defined(_M_ARM64)" arm64 ${VARIABLE})
elseif(ARCH STREQUAL "loongarch64") elseif(ARCH STREQUAL "loongarch64")
_internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE}) _internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE})
elseif(ARCH STREQUAL "emscripten")
_internal_check_cpu_architecture("defined(__EMSCRIPTEN__)" emscripten ${VARIABLE})
else() else()
message(WARNING "Unknown CPU architectures (${ARCH}).") message(WARNING "Unknown CPU architectures (${ARCH}).")
set(${VARIABLE} FALSE) set(${VARIABLE} FALSE)

View File

@ -52,6 +52,8 @@ macro(SDL_DetectCMakePlatform)
set(SDL_CMAKE_PLATFORM Minix) set(SDL_CMAKE_PLATFORM Minix)
elseif(CMAKE_SYSTEM_NAME MATCHES "Android.*") elseif(CMAKE_SYSTEM_NAME MATCHES "Android.*")
set(SDL_CMAKE_PLATFORM Android) set(SDL_CMAKE_PLATFORM Android)
elseif(CMAKE_SYSTEM_NAME MATCHES "Emscripten.*")
set(SDL_CMAKE_PLATFORM Emscripten)
elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*") elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
message_error("BeOS support has been removed as of SDL 2.0.2.") message_error("BeOS support has been removed as of SDL 2.0.2.")
endif() endif()
@ -76,7 +78,7 @@ function(SDL_DetectCPUArchitecture)
endforeach() endforeach()
endif() 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) 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})