Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save markkimsal/c9bf2caa7cf86c3f8c22e267faec0510 to your computer and use it in GitHub Desktop.
Save markkimsal/c9bf2caa7cf86c3f8c22e267faec0510 to your computer and use it in GitHub Desktop.
cross compile libSDL2 for macos darwin
install zig
install libobjc
get macosX SDK from hexops.
get SDL2
mkdir build; cd build;
```
CC="zig cc -target x86_64-macos -F /SDKs/sdk-macos-13.3/root/System/Library/Frameworks -iframework /SDKs/sdk-macos-13.3/root/System/Library/Frameworks -I /SDKs/sdk-macos-13.3/root/usr/include -fno-sanitize=undefined -Wno-nullability-completeness -Wno-undef-prefix -Wno-availability -Wno-expansion-to-defined" CXX="zig c++ -target x86_64-macos" AR="zig ar" RANLIB="zig ranlib" ../configure --host=x86_64-macos-darwin --prefix=$(pwd)/prebuilt/x86_64-macos-darwin --exec-prefix=$(pwd)/prebuilt/x86_64-macos-darwin
make
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment