godot-cpp icon indicating copy to clipboard operation
godot-cpp copied to clipboard

Don't build universal binaries for macOS / iOS when dev_build=yes, to save on dev build time

Open Ivorforce opened this issue 1 year ago • 4 comments

This change just about halves my build time (godot-cpp as an example):

  • 8:30 building universal
  • 4:30 building x86_64

Unsurprisingly, it also halves my build size:

  • 772mb universal
  • 388mb x86_64

While I agree that macOS export default should be universal, in dev mode it would be better to default to single arch.

Ivorforce avatar Oct 04 '24 19:10 Ivorforce

As far as I can see, godot is not capable of building universal at all. I think they must build the two arches separately and join them together after the build.

Edit: Confirmed, at least the GitHub runner runs them separately and then:

https://github.com/godotengine/godot/blob/a3080477ac0421aef24ca0916c40559abbf4846b/.github/workflows/macos_builds.yml#L79

Ivorforce avatar Oct 05 '24 17:10 Ivorforce

Ah, ok, so we're doing something totally different than Godot. :-/ I guess we'll need to decide if we want to switch to matching Godot, update Godot to match godot-cpp, or decide if we have a compelling argument to differ from Godot. This is probably worth discussing at an upcoming GDExtension meeting.

dsnopek avatar Oct 05 '24 17:10 dsnopek

Switching to a built-twice-then-join approach may actually be better in more ways than just feature parity. I've run into the problem already that passing arch-specific flags (like -mavx) stops the build entirely. There may be a way to detect these kinds of args in the CCFlags, and split them for the two different compiles, but that seems fruitless long term.

Ivorforce avatar Oct 07 '24 17:10 Ivorforce

Making this a draft because it may be superseded by #1633.

Ivorforce avatar Oct 29 '24 20:10 Ivorforce