Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
为 macOS 平台编译¶
备注
这个页面描述的是如何从源码编译 macOS 编辑器和导出模板二进制文件。如果你要找的是导出项目到 macOS,请阅读 为 macOS 导出。
需求¶
在 macOS 下编译时,需要以下条件:
SCons 3.0+ 构建系统.
Xcode(或更轻量的 Xcode 命令行工具)。
Vulkan SDK for MoltenVK (macOS doesn't support Vulkan out of the box).
编译¶
启动终端, 进入引擎源代码的根目录.
若要为英特尔(x86-64)架构的 Mac 编译,请使用:
scons platform=macos arch=x86_64
要为 Apple Silicon(ARM64)驱动的 Mac 编译,请使用:
scons platform=macos arch=arm64
如果要通过“Universal 2”二进制来同时支持这两种架构,请运行上述两个命令,然后使用 lipo
将它们打包在一起:
lipo -create bin/godot.macos.editor.x86_64 bin/godot.macos.editor.arm64 -output bin/godot.macos.editor.universal
If all goes well, the resulting binary executable will be placed in the
bin/
subdirectory. This executable file contains the whole engine and
runs without any dependencies. Executing it will bring up the Project
Manager.