Skip to content

Add macOS build support - #1

Open
peterpeerdeman wants to merge 1 commit into
samegens:mainfrom
peterpeerdeman:macos-build-support
Open

peterpeerdeman wants to merge 1 commit into
samegens:mainfrom
peterpeerdeman:macos-build-support

Conversation

@peterpeerdeman

@peterpeerdeman peterpeerdeman commented Aug 3, 2026 •

Copy link
Copy Markdown

Hi Sebastiaan, waar het de vorige keer nog mislukte is het fable deze keer wel gelukt om samtris werkend te krijgen op mac os, onder andere omdat de dependency upstream gefixed was 😁

Summary

This makes the project build and run on macOS, where it previously failed to link.

  • Add .cargo/config.toml with Apple-target-only linker search paths for Homebrew-installed SDL2 libraries (brew install sdl2 sdl2_image sdl2_ttf). Linux builds are unaffected.
  • Upgrade the sdl2 crate from 0.37 to 0.38. Homebrew's sdl2 package is nowadays sdl2-compat (SDL2 API on top of SDL3), which delivers an SDL3-numbered event (0x207) during window creation on Retina displays. sdl2 0.37 converts raw event types with an unchecked transmute, which aborts on that value; 0.38 matches on the raw value and handles unknown events gracefully. No source changes were needed for the upgrade.

Testing

  • cargo build and cargo run on macOS 15 (Apple Silicon): game launches and plays without the previous startup abort.
  • All 348 tests pass with sdl2 0.38.

🤖 Generated with Claude Code

Link against Homebrew SDL2 libs on macOS via .cargo/config.toml, and
upgrade sdl2 crate to 0.38 so SDL3-numbered events leaked by
sdl2-compat no longer abort the game on startup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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