Skip to content

Commit a006304

Browse files
committed
Merge branch 'main' of https://github.com/TheSniperFan/SDL
# Conflicts: # include/SDL3/SDL_gpu.h
2 parents da4f2f9 + b02e56c commit a006304

File tree

309 files changed

+17251
-7581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+17251
-7581
lines changed

.github/workflows/create-test-plan.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class JobOs(Enum):
3030
Ubuntu22_04 = "ubuntu-22.04"
3131
Ubuntu24_04 = "ubuntu-24.04"
3232
Ubuntu24_04_arm = "ubuntu-24.04-arm"
33-
Macos13 = "macos-13" # macOS Ventura (2022)
33+
Macos14 = "macos-14" # macOS Sonoma (2023)
34+
Macos15 = "macos-15" # macOS Sequoia (2024)
3435
Macos26 = "macos-26" # macOS Tahoe (2025)
3536

3637

@@ -99,6 +100,7 @@ class JobSpec:
99100
clang_cl: bool = False
100101
gdk: bool = False
101102
vita_gles: Optional[VitaGLES] = None
103+
more_hard_deps: bool = False
102104

103105

104106
JOB_SPECS = {
@@ -115,11 +117,11 @@ class JobSpec:
115117
"ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", ),
116118
"ubuntu-latest": JobSpec(name="Ubuntu (latest)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-ubuntu-latest", ),
117119
"ubuntu-24.04-arm64": JobSpec(name="Ubuntu 24.04 (ARM64)", os=JobOs.Ubuntu24_04_arm, platform=SdlPlatform.Linux, artifact="SDL-ubuntu24.04-arm64", ),
118-
"steamrt3": JobSpec(name="Steam Linux Runtime 3.0 (x86_64)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-steamrt3", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest", ),
119-
"steamrt3-arm64": JobSpec(name="Steam Linux Runtime 3.0 (arm64)", os=JobOs.Ubuntu24_04_arm, platform=SdlPlatform.Linux, artifact="SDL-steamrt3-arm64", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk/arm64:latest", ),
120+
"steamrt3": JobSpec(name="Steam Linux Runtime 3.0 (x86_64)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-steamrt3", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest", more_hard_deps = True, ),
121+
"steamrt3-arm64": JobSpec(name="Steam Linux Runtime 3.0 (arm64)", os=JobOs.Ubuntu24_04_arm, platform=SdlPlatform.Linux, artifact="SDL-steamrt3-arm64", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk/arm64:latest", more_hard_deps = True, ),
120122
"ubuntu-intel-icx": JobSpec(name="Ubuntu 22.04 (Intel oneAPI)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-oneapi", intel=IntelCompiler.Icx, ),
121123
"ubuntu-intel-icc": JobSpec(name="Ubuntu 22.04 (Intel Compiler)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-icc", intel=IntelCompiler.Icc, ),
122-
"macos-framework-x64": JobSpec(name="MacOS (Framework) (x64)", os=JobOs.Macos13, platform=SdlPlatform.MacOS, artifact="SDL-macos-framework", apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, xcode=True, ),
124+
"macos-framework-x64": JobSpec(name="MacOS (Framework) (x64)", os=JobOs.Macos14, platform=SdlPlatform.MacOS, artifact="SDL-macos-framework", apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, xcode=True, ),
123125
"macos-framework-arm64": JobSpec(name="MacOS (Framework) (arm64)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact=None, apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, ),
124126
"macos-26-framework-arm64": JobSpec(name="MacOS 26 (Framework) (arm64)",os=JobOs.Macos26, platform=SdlPlatform.MacOS, artifact=None, apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, ),
125127
"macos-gnu-arm64": JobSpec(name="MacOS (GNU prefix)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact="SDL-macos-arm64-gnu", apple_framework=False, apple_archs={AppleArch.Aarch64, }, ),
@@ -447,6 +449,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
447449
"libxfixes-dev",
448450
"libxi-dev",
449451
"libxss-dev",
452+
"libxtst-dev",
450453
"libwayland-dev",
451454
"libxkbcommon-dev",
452455
"libdrm-dev",
@@ -482,6 +485,19 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
482485
job.shared_lib = SharedLibType.SO_0
483486
job.static_lib = StaticLibType.A
484487
fpic = True
488+
if spec.more_hard_deps:
489+
# Some distros prefer to make important dependencies
490+
# mandatory, so that SDL won't start up but lack expected
491+
# functionality if they're missing
492+
job.cmake_arguments.extend([
493+
"-DSDL_ALSA_SHARED=OFF",
494+
"-DSDL_FRIBIDI_SHARED=OFF",
495+
"-DSDL_HIDAPI_LIBUSB_SHARED=OFF",
496+
"-DSDL_PULSEAUDIO_SHARED=OFF",
497+
"-DSDL_X11_SHARED=OFF",
498+
"-DSDL_WAYLAND_LIBDECOR_SHARED=OFF",
499+
"-DSDL_WAYLAND_SHARED=OFF",
500+
])
485501
case SdlPlatform.Ios | SdlPlatform.Tvos:
486502
job.brew_packages.extend([
487503
"ccache",
@@ -535,8 +551,6 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
535551
job.shared_lib = SharedLibType.DYLIB
536552
job.static_lib = StaticLibType.A
537553
job.ccache = True
538-
if spec.os == JobOs.Macos13:
539-
job.ccache = False
540554
job.apt_packages = []
541555
job.brew_packages.extend((
542556
"ninja",

.github/workflows/release.yml

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ jobs:
9191
sudo apt-get install -y \
9292
gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev \
9393
libusb-1.0-0-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev \
94-
libxss-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
95-
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
94+
libxss-dev libxtst-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev \
95+
libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
9696
- name: 'CMake (configure + build + tests + examples)'
9797
run: |
9898
cmake -S ${{ steps.tar.outputs.path }} -B /tmp/build -DSDL_TEST_LIBRARY=TRUE -DSDL_TESTS=TRUE -DSDL_EXAMPLES=TRUE
@@ -204,10 +204,22 @@ jobs:
204204
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
205205
-DCMAKE_SYSTEM_NAME=iOS \
206206
-DCMAKE_OSX_ARCHITECTURES="arm64" \
207-
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
207+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
208208
-Werror=dev \
209209
-B build_ios
210210
cmake --build build_ios --config Release --verbose
211+
212+
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
213+
-DTEST_FULL=FALSE \
214+
-DTEST_STATIC=FALSE \
215+
-DTEST_TEST=FALSE \
216+
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/SDL3.xcframework/ios-arm64" \
217+
-DCMAKE_SYSTEM_NAME=iOS \
218+
-DCMAKE_OSX_ARCHITECTURES="arm64" \
219+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
220+
-Werror=dev \
221+
-B build_ios2
222+
cmake --build build_ios2 --config Release --verbose
211223
- name: 'CMake (configure + build) tvOS'
212224
run: |
213225
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
@@ -217,10 +229,22 @@ jobs:
217229
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
218230
-DCMAKE_SYSTEM_NAME=tvOS \
219231
-DCMAKE_OSX_ARCHITECTURES="arm64" \
220-
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
232+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
221233
-Werror=dev \
222234
-B build_tvos
223235
cmake --build build_tvos --config Release --verbose
236+
237+
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
238+
-DTEST_FULL=FALSE \
239+
-DTEST_STATIC=FALSE \
240+
-DTEST_TEST=FALSE \
241+
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/SDL3.xcframework/tvos-arm64" \
242+
-DCMAKE_SYSTEM_NAME=tvOS \
243+
-DCMAKE_OSX_ARCHITECTURES="arm64" \
244+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
245+
-Werror=dev \
246+
-B build_tvos2
247+
cmake --build build_tvos2 --config Release --verbose
224248
- name: 'CMake (configure + build) iOS simulator'
225249
run: |
226250
sysroot=$(xcodebuild -version -sdk iphonesimulator Path)
@@ -237,6 +261,19 @@ jobs:
237261
-Werror=dev \
238262
-B build_ios_simulator
239263
cmake --build build_ios_simulator --config Release --verbose
264+
265+
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
266+
-DTEST_FULL=FALSE \
267+
-DTEST_STATIC=FALSE \
268+
-DTEST_TEST=FALSE \
269+
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/SDL3.xcframework/ios-arm64_x86_64-simulator" \
270+
-DCMAKE_SYSTEM_NAME=iOS \
271+
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
272+
-DCMAKE_OSX_SYSROOT="${sysroot}" \
273+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
274+
-Werror=dev \
275+
-B build_ios_simulator2
276+
cmake --build build_ios_simulator2 --config Release --verbose
240277
- name: 'CMake (configure + build) tvOS simulator'
241278
run: |
242279
sysroot=$(xcodebuild -version -sdk appletvsimulator Path)
@@ -254,6 +291,19 @@ jobs:
254291
-B build_tvos_simulator
255292
cmake --build build_tvos_simulator --config Release --verbose
256293
294+
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
295+
-DTEST_FULL=FALSE \
296+
-DTEST_STATIC=FALSE \
297+
-DTEST_TEST=FALSE \
298+
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/SDL3.xcframework/tvos-arm64_x86_64-simulator" \
299+
-DCMAKE_SYSTEM_NAME=tvOS \
300+
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
301+
-DCMAKE_OSX_SYSROOT="${sysroot}" \
302+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
303+
-Werror=dev \
304+
-B build_tvos_simulator2
305+
cmake --build build_tvos_simulator2 --config Release --verbose
306+
257307
msvc:
258308
needs: [src]
259309
runs-on: windows-2025

.gitignore

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,17 @@ Release
7777
*.ncb
7878
*.suo
7979
*.sdf
80-
VisualC/tests/gamepadmap/axis.bmp
81-
VisualC/tests/gamepadmap/button.bmp
82-
VisualC/tests/gamepadmap/gamepadmap.bmp
83-
VisualC/tests/gamepadmap/gamepadmap_back.bmp
8480
VisualC/tests/loopwave/sample.wav
8581
VisualC/tests/testautomation/*.bmp
86-
VisualC/tests/testgamepad/axis.bmp
87-
VisualC/tests/testgamepad/button.bmp
88-
VisualC/tests/testgamepad/gamepadmap.bmp
89-
VisualC/tests/testgamepad/gamepadmap_back.bmp
82+
VisualC/tests/testautomation/*.png
83+
VisualC/tests/testcontroller/*.png
9084
VisualC/tests/testoverlay/moose.dat
91-
VisualC/tests/testrendertarget/icon.bmp
92-
VisualC/tests/testrendertarget/sample.bmp
93-
VisualC/tests/testscale/icon.bmp
94-
VisualC/tests/testscale/sample.bmp
95-
VisualC/tests/testsprite/icon.bmp
96-
VisualC/tests/testyuv/testyuv.bmp
85+
VisualC/tests/testrendertarget/icon.png
86+
VisualC/tests/testrendertarget/sample.png
87+
VisualC/tests/testscale/icon.png
88+
VisualC/tests/testscale/sample.png
89+
VisualC/tests/testsprite/icon.png
90+
VisualC/tests/testyuv/testyuv.png
9791
VisualC-GDK/**/Layout
9892
src/render/direct3d12/D3D12_*_One.h
9993
src/render/direct3d12/D3D12_*_Series.h

CMakeLists.txt

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if(NOT DEFINED CMAKE_BUILD_TYPE)
55
endif()
66

77
# See docs/release_checklist.md
8-
project(SDL3 LANGUAGES C VERSION "3.3.0")
8+
project(SDL3 LANGUAGES C VERSION "3.3.3")
99

1010
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
1111
set(SDL3_MAINPROJECT ON)
@@ -914,6 +914,7 @@ if(SDL_ASSEMBLY)
914914
set(HAVE_ALTIVEC TRUE)
915915
set(SDL_ALTIVEC_BLITTERS 1)
916916
sdl_compile_options(PRIVATE "-maltivec")
917+
sdl_compile_options(PRIVATE "-fno-tree-vectorize")
917918
set_property(SOURCE "${SDL3_SOURCE_DIR}/src/video/SDL_blit_N.c" APPEND PROPERTY COMPILE_DEFINITIONS "SDL_ENABLE_ALTIVEC")
918919
set_property(SOURCE "${SDL3_SOURCE_DIR}/src/video/SDL_blit_N.c" PROPERTY SKIP_PRECOMPILE_HEADERS 1)
919920
endif()
@@ -931,7 +932,17 @@ if(SDL_ASSEMBLY)
931932
cmake_pop_check_state()
932933

933934
if(COMPILER_SUPPORTS_LSX AND HAVE_LSXINTRIN_H)
934-
set_property(SOURCE "${SDL3_SOURCE_DIR}/src/video/yuv2rgb/yuv_rgb_lsx.c" APPEND PROPERTY COMPILE_OPTIONS "-mlsx")
935+
set_property(SOURCE
936+
"${SDL3_SOURCE_DIR}/src/video/yuv2rgb/yuv_rgb_lsx.c"
937+
"${SDL3_SOURCE_DIR}/src/video/SDL_blit_A.c"
938+
"${SDL3_SOURCE_DIR}/src/video/SDL_fillrect.c"
939+
APPEND PROPERTY COMPILE_OPTIONS "-mlsx")
940+
941+
set_property(SOURCE
942+
"${SDL3_SOURCE_DIR}/src/video/yuv2rgb/yuv_rgb_lsx.c"
943+
"${SDL3_SOURCE_DIR}/src/video/SDL_blit_A.c"
944+
"${SDL3_SOURCE_DIR}/src/video/SDL_fillrect.c"
945+
PROPERTY SKIP_PRECOMPILE_HEADERS 1)
935946
set(HAVE_LSX TRUE)
936947
endif()
937948
endif()
@@ -1005,7 +1016,14 @@ set(SDL_DISABLE_ALLOCA 0)
10051016
check_include_file("alloca.h" "HAVE_ALLOCA_H")
10061017
if(MSVC)
10071018
check_include_file("malloc.h" "HAVE_MALLOC_H")
1008-
check_symbol_exists("_alloca" "malloc.h" _ALLOCA_IN_MALLOC_H)
1019+
# Cannot use CheckSymbolExists for _alloca: purely intrinsic functions have no address (C7552)
1020+
if(NOT DEFINED _ALLOCA_IN_MALLOC_H)
1021+
message(STATUS "Looking for _alloca in malloc.h")
1022+
set(testsrc "${CMAKE_CURRENT_SOURCE_DIR}/test_malloc_alloca.c")
1023+
file(WRITE "${testsrc}" "#include <malloc.h>\n\nint main(int argc, char *argv[]) { void *ptr = _alloca(argc * (int)argv[0][0]); return ptr != (void *)0; }")
1024+
try_compile(_ALLOCA_IN_MALLOC_H "${CMAKE_CURRENT_BINARY_DIR}/alloca_in_malloc_h" SOURCES "${testsrc}")
1025+
message(STATUS "Looking for _alloca in malloc.h - ${_ALLOCA_IN_MALLOC_H}")
1026+
endif()
10091027
if(NOT HAVE_ALLOCA_H AND NOT _ALLOCA_IN_MALLOC_H)
10101028
set(SDL_DISABLE_ALLOCA 1)
10111029
endif()
@@ -1144,7 +1162,7 @@ if(SDL_LIBC)
11441162
check_symbol_exists(sysctlbyname "sys/types.h;sys/sysctl.h" HAVE_SYSCTLBYNAME)
11451163
check_symbol_exists(getauxval "sys/auxv.h" HAVE_GETAUXVAL)
11461164
check_symbol_exists(elf_aux_info "sys/auxv.h" HAVE_ELF_AUX_INFO)
1147-
check_symbol_exists(poll "poll.h" HAVE_POLL)
1165+
check_symbol_exists(ppoll "poll.h" HAVE_PPOLL)
11481166
check_symbol_exists(memfd_create "sys/mman.h" HAVE_MEMFD_CREATE)
11491167
check_symbol_exists(posix_fallocate "fcntl.h" HAVE_POSIX_FALLOCATE)
11501168
check_symbol_exists(posix_spawn_file_actions_addchdir "spawn.h" HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
@@ -1708,6 +1726,15 @@ elseif(EMSCRIPTEN)
17081726
set(HAVE_CLOCK_GETTIME 1)
17091727
endif()
17101728

1729+
if(SDL_SENSOR)
1730+
set(SDL_SENSOR_EMSCRIPTEN 1)
1731+
set(HAVE_SDL_SENSORS TRUE)
1732+
sdl_glob_sources(
1733+
"${SDL3_SOURCE_DIR}/src/sensor/emscripten/*.c"
1734+
"${SDL3_SOURCE_DIR}/src/sensor/emscripten/*.h"
1735+
)
1736+
endif()
1737+
17111738
if(SDL_VIDEO)
17121739
set(SDL_VIDEO_DRIVER_EMSCRIPTEN 1)
17131740
sdl_glob_sources(
@@ -1741,9 +1768,10 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
17411768
return argc + dlnote.hdr.a;
17421769
}
17431770
]==])
1771+
set(SDL_DISABLE_DLOPEN_NOTES FALSE)
17441772
check_c_source_compiles("${CHECK_ELF_DLNOTES_SRC}" COMPILER_SUPPORTS_ELFNOTES)
1745-
if(COMPILER_SUPPORTS_ELFNOTES)
1746-
set(HAVE_DLOPEN_NOTES TRUE)
1773+
if(NOT COMPILER_SUPPORTS_ELFNOTES)
1774+
set(SDL_DISABLE_DLOPEN_NOTES TRUE)
17471775
endif()
17481776
endif()
17491777

@@ -3444,7 +3472,10 @@ int main(void)
34443472
return 0;
34453473
}
34463474
" HAVE_POSIX_SPAWN)
3447-
if(HAVE_POSIX_SPAWN)
3475+
if(NOT APPLE)
3476+
check_symbol_exists(vfork "unistd.h" LIBC_HAS_VFORK)
3477+
endif()
3478+
if(HAVE_POSIX_SPAWN AND (APPLE OR LIBC_HAS_VFORK))
34483479
sdl_glob_sources(
34493480
"${SDL3_SOURCE_DIR}/src/process/posix/*.c"
34503481
"${SDL3_SOURCE_DIR}/src/process/posix/*.h"

0 commit comments

Comments
 (0)