diff options
author | 3gg <3gg@shellblade.net> | 2025-08-30 16:53:58 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2025-08-30 16:53:58 -0700 |
commit | 6aaedb813fa11ba0679c3051bc2eb28646b9506c (patch) | |
tree | 34acbfc9840e02cb4753e6306ea7ce978bf8b58e /src/contrib/SDL-3.2.20/cmake/sdlplatform.cmake | |
parent | 8f228ade99dd3d4c8da9b78ade1815c9adf85c8f (diff) |
Update to SDL3
Diffstat (limited to 'src/contrib/SDL-3.2.20/cmake/sdlplatform.cmake')
-rw-r--r-- | src/contrib/SDL-3.2.20/cmake/sdlplatform.cmake | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/cmake/sdlplatform.cmake b/src/contrib/SDL-3.2.20/cmake/sdlplatform.cmake new file mode 100644 index 0000000..677b187 --- /dev/null +++ b/src/contrib/SDL-3.2.20/cmake/sdlplatform.cmake | |||
@@ -0,0 +1,70 @@ | |||
1 | function(SDL_DetectCMakePlatform) | ||
2 | set(sdl_cmake_platform ) | ||
3 | if(WIN32) | ||
4 | set(sdl_cmake_platform Windows) | ||
5 | elseif(PSP) | ||
6 | set(sdl_cmake_platform psp) | ||
7 | elseif(APPLE) | ||
8 | if(CMAKE_SYSTEM_NAME MATCHES ".*(Darwin|MacOS).*") | ||
9 | set(sdl_cmake_platform macOS) | ||
10 | elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*") | ||
11 | set(sdl_cmake_platform tvOS) | ||
12 | elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*") | ||
13 | set(sdl_cmake_platform iOS) | ||
14 | elseif(CMAKE_SYSTEM_NAME MATCHES ".*watchOS.*") | ||
15 | set(sdl_cmake_platform watchOS) | ||
16 | elseif (CMAKE_SYSTEM_NAME MATCHES "visionOS") | ||
17 | set(sdl_cmake_platform visionOS) | ||
18 | else() | ||
19 | message(WARNING "Unknown Apple platform: \"${CMAKE_SYSTEM_NAME}\"") | ||
20 | endif() | ||
21 | elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*") | ||
22 | set(sdl_cmake_platform Haiku) | ||
23 | elseif(NINTENDO_3DS) | ||
24 | set(sdl_cmake_platform n3ds) | ||
25 | elseif(PS2) | ||
26 | set(sdl_cmake_platform ps2) | ||
27 | elseif(VITA) | ||
28 | set(sdl_cmake_platform Vita) | ||
29 | elseif(CMAKE_SYSTEM_NAME MATCHES ".*Linux") | ||
30 | set(sdl_cmake_platform Linux) | ||
31 | elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*") | ||
32 | set(sdl_cmake_platform FreeBSD) | ||
33 | elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*") | ||
34 | set(sdl_cmake_platform NetBSD) | ||
35 | elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*") | ||
36 | set(sdl_cmake_platform OpenBSD) | ||
37 | elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*") | ||
38 | set(sdl_cmake_platform GNU) | ||
39 | elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*") | ||
40 | set(sdl_cmake_platform BSDi) | ||
41 | elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD") | ||
42 | set(sdl_cmake_platform FreeBSD) | ||
43 | elseif(CMAKE_SYSTEM_NAME MATCHES "SYSV5.*") | ||
44 | set(sdl_cmake_platform SYSV5) | ||
45 | elseif(CMAKE_SYSTEM_NAME MATCHES "Solaris.*|SunOS.*") | ||
46 | set(sdl_cmake_platform Solaris) | ||
47 | elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX.*") | ||
48 | set(sdl_cmake_platform HPUX) | ||
49 | elseif(CMAKE_SYSTEM_NAME MATCHES "AIX.*") | ||
50 | set(sdl_cmake_platform AIX) | ||
51 | elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*") | ||
52 | set(sdl_cmake_platform Minix) | ||
53 | elseif(CMAKE_SYSTEM_NAME MATCHES "Android.*") | ||
54 | set(sdl_cmake_platform Android) | ||
55 | elseif(CMAKE_SYSTEM_NAME MATCHES "Emscripten.*") | ||
56 | set(sdl_cmake_platform Emscripten) | ||
57 | elseif(CMAKE_SYSTEM_NAME MATCHES "QNX.*") | ||
58 | set(sdl_cmake_platform QNX) | ||
59 | elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*") | ||
60 | message(FATAL_ERROR "BeOS support has been removed as of SDL 2.0.2.") | ||
61 | endif() | ||
62 | |||
63 | if(sdl_cmake_platform) | ||
64 | string(TOUPPER "${sdl_cmake_platform}" _upper_platform) | ||
65 | set("${_upper_platform}" TRUE PARENT_SCOPE) | ||
66 | else() | ||
67 | set(sdl_cmake_platform "unknown") | ||
68 | endif() | ||
69 | set(SDL_CMAKE_PLATFORM "${sdl_cmake_platform}" PARENT_SCOPE) | ||
70 | endfunction() | ||