Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS cross compilation #8

Open
slimsag opened this issue Jul 18, 2021 · 1 comment
Open

MacOS cross compilation #8

slimsag opened this issue Jul 18, 2021 · 1 comment

Comments

@slimsag
Copy link
Sponsor

slimsag commented Jul 18, 2021

Hey there!

I'm working on GLFW bindings for Zig that are zero-fuss and support cross compilation. You can read more about how I'm approaching this here.

I noticed your README says:

Right now, it's not possible to cross-compile for MacOS, which is very sad. We might find a way to do so, though! Also VCPKG is not well supported on windows platforms.

I wanted to say I think you can use the same method I'm using for cross compiling GLFW from Linux/Windows -> macOS. Basically, I have packaged the macOS SDK required for cross compilation and have it at https://github.com/hexops/sdk-macos-11.3 -- this also works for compiling on macOS without Xcode installed, which I think is quite nice.

Then from your Zig build script, you can automatically clone it and link it in where needed. e.g. as I am doing here: https://github.com/hexops/mach/blob/main/glfw/build.zig#L196-L270

Feel free to use the same hexops/sdk-macos-11.3 repository if you like (it won't change.) and reuse whatever bits of my build script are useful to you, it's all FOSS :) I'm not actually using SDL.zig, just wanted to offer this as an idea. Feel free to dismiss if not helpful!

@ikskuh
Copy link
Owner

ikskuh commented Jul 19, 2021

I'll check it out if i find the time!

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

No branches or pull requests

2 participants