Skip to content

sdl3: update to 3.4.2, fix macOS platform routing#2726

Open
TommyLau wants to merge 1 commit intomesonbuild:masterfrom
TommyLau:sdl3-3.4.2
Open

sdl3: update to 3.4.2, fix macOS platform routing#2726
TommyLau wants to merge 1 commit intomesonbuild:masterfrom
TommyLau:sdl3-3.4.2

Conversation

@TommyLau
Copy link
Copy Markdown

Summary

Update SDL3 from 3.4.0 to 3.4.2 and fix multiple macOS build issues.

Version upgrade (3.4.0 → 3.4.2)

  • Update sdl3.wrap source URL, hash, and directory
  • Update project() version in meson.build
  • No source file additions/deletions/renames between 3.4.0 and 3.4.2 (verified via git diff --diff-filter=ADR)
  • SDL_build_config.h.cmake template unchanged (453 cmakedefines, identical)

macOS bug fixes

Missing config defines:

  • Add SDL_AUDIO_DRIVER_COREAUDIO in src/audio/meson.build (macOS audio was broken)
  • Add SDL_VIDEO_DRIVER_COCOA in src/video/meson.build (macOS video driver not recognized)

Missing Apple frameworks:

  • Add AudioToolbox, AVFoundation, CoreMedia, CoreVideo to appleframeworks (caused linker errors: _AudioQueueAllocateBuffer etc.)

Static library dependency propagation:

  • Add dependencies: sdl_deps to declare_dependency() so framework deps propagate when linking statically

Platform routing (5 subsystems):

Multiple src/*/meson.build files only had if windows / else branches, causing macOS (darwin) to fall into the Linux else branch with wrong backends:

Subsystem Was using (wrong) Now uses (correct)
src/filesystem/ unix/ cocoa/ + posix/
src/dialog/ unix/ (Zenity) cocoa/ (native)
src/misc/ unix/ (xdg-open) macos/ (NSWorkspace)
src/locale/ unix/ macos/ (NSLocale)
src/tray/ unix/ cocoa/ (native)

Also populated 5 empty subdirectory meson.build files with correct .m source files:

  • src/filesystem/cocoa/meson.buildSDL_sysfilesystem.m
  • src/dialog/cocoa/meson.buildSDL_cocoadialog.m
  • src/misc/macos/meson.buildSDL_sysurl.m
  • src/locale/macos/meson.buildSDL_syslocale.m
  • src/tray/cocoa/meson.buildSDL_tray.m

Testing

  • Tested on macOS 15.4 (Apple Silicon, clang 17)
  • meson setup builddir -Dwraps=sdl3 && meson compile -C builddir passes (196/196)
  • python3 tools/sanity_checks.py passes (4 tests OK)
  • Full project build with sdl3 + sdl3_mixer as dependencies: 514/514 targets pass

Update SDL3 from 3.4.0 to 3.4.2.

Fix macOS issues in the meson build port:
- Add missing SDL_AUDIO_DRIVER_COREAUDIO define for macOS
- Add missing SDL_VIDEO_DRIVER_COCOA define for macOS
- Add missing frameworks: AudioToolbox, AVFoundation, CoreMedia, CoreVideo
- Fix declare_dependency to propagate framework deps (required for static linking)
- Fix 5 subsystem routing where macOS fell into Linux else branch:
  filesystem (cocoa/ not unix/), dialog (cocoa/ not unix/),
  misc (macos/ not unix/), locale (macos/ not unix/), tray (cocoa/ not unix/)
- Populate empty subdirectory meson.build files with correct .m source files
@TommyLau TommyLau closed this Mar 29, 2026
@TommyLau TommyLau reopened this Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant