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] Add support for the Apple Silicon (ARM64) build target. #39788

Merged
merged 1 commit into from
Jul 1, 2020

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Jun 23, 2020

Adds support for ARM64 target on macOS (with -arch arm64 option, targets x86-64 when arch is not specified).

  • Tested to build with Xcode 12.0 beta for macOS universal apps (12A8158a).
  • NOT tested on real hardware.
  • OpenImage Denoise is disabled for ARM64 build (current version of oneDNN doesn't support ARM, but experimental support should be available in upstream).
  • libvpx builds, but configuration might be not fully optimal.

Universal binary can be created in the similar manner to iOS (currently this step is not automated):

lipo -create ./bin/godot.osx.opt.tools.64 ./bin/godot.osx.opt.tools.arm64 -output ./bin/godot.osx.opt.tools.universal

@Calinou
Copy link
Member

Calinou commented Jun 23, 2020

That was fast. 👀

Great work as always!

@ee0pdt
Copy link

ee0pdt commented Jun 24, 2020

Came here to request this... and as always you guys are already on it!

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good.

@akien-mga
Copy link
Member

I guess it might be worth making the 3.2 branch Silicon-ready too, so that games published with 3.2.3+ will keep working once the hardware hits the market. Could you make a PR for 3.2?

BTW, you built with Xcode 12.0 beta, is there also a simulator for arm64 that can be used or do we have to wait for actual hardware to test?

@bruvzg
Copy link
Member Author

bruvzg commented Jun 29, 2020

is there also a simulator for arm64 that can be used or do we have to wait for actual hardware to test?

No, at least in current beta there's no simulator for arm64 macOS.

@bruvzg
Copy link
Member Author

bruvzg commented Jun 29, 2020

Could you make a PR for 3.2?

PR for 3.2 - #39943

@akien-mga akien-mga merged commit 5c9ee93 into godotengine:master Jul 1, 2020
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

@bruvzg BTW, this might need to be updated too I guess:

platform/osx/export/export.cpp
564:    String binary_to_use = "godot_osx_" + String(p_debug ? "debug" : "release") + ".64";

Though we probably want to keep support for having a x86_64-only template or an universal one, and it doesn't make a difference for the exporting step, so maybe we should support both or simply drop the suffix.

@@ -5,7 +5,7 @@ def can_build(env, platform):
# as doing lightmap generation and denoising on Android or HTML5
# would be a bit far-fetched.
desktop_platforms = ["linuxbsd", "osx", "windows"]
return env["tools"] and platform in desktop_platforms and env["bits"] == "64"
return env["tools"] and platform in desktop_platforms and env["bits"] == "64" and env["arch"] != "arm64"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bruvzg Doesn't this make the above comment obsolete? It seems that only x86_64 is supported, not just "64-bit architectures".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version we are using is x86_64 only, newer versions of oneDNN should support arm64 as well (there were some issues with updating it, I do not remember what's exactly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants