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

[WIP] fix: adjust the way gd build macos executables #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jugglingjsons
Copy link

@jugglingjsons jugglingjsons commented Jul 22, 2024

Context:

Godot 4.22 allows us to use universal builds to package extensions for macOS into a single binary, source

As discussed here

This is a first draft, let me know what would need adjustment.
I am not sure if this way of handling the error for lipos existence will be ok.

Left to do:

  • write some simple tests
  • actually verify it runs locally
  • align on lipo check
  • possibly extend the build commands with c build optimisation flags to strip the unused language feature for performance
  • align on if this should be optional or the default behaviour, imo default because of Go's cross platform promises (that said it increases the bundle size a bit)

@Splizard
Copy link
Contributor

Thanks for the PR! It looks like it will work as intended, I guess my questions around supporting universal builds on Mac:

  1. Is it slow to compile the project twice each time? I suspect most of the time, a developer would be building something they can run inside Godot immediately, have you noticed any significantly increased build latency here?
  2. Can we assume lipo will (most of the time) be available and already installed on Mac?
  3. Is it the case that CGO just works on Mac when compiling between arm64 and amd64?

In regards to point 3, I've been considering depending on zig cc to enable CGO cross-compiling between any supported platform.

possibly extend the build commands with c build optimisation flags to strip the unused language feature for performance

This sounds like a good idea for sure. I think you may have already commented that this had a noticable difference.

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.

2 participants