从源代码构建

Godot prides itself on being very easy to build, by C++ projects' standards. Godot uses the SCons build system, and after the initial setup compiling the engine for your current platform should be as easy as running:

scons

But you will probably need to use at least some of the available options to configure the build to match your specific needs, be it a custom engine fork, a lightweight build stripped of extra modules, or an executable targeting engine development.

The articles below should help you navigate configuration options available, as well as prerequisites required to compile Godot exactly the way you need.

构建 Godot 的基础知识

让我们从基础开始,学习如何获取 Godot 的源代码,然后使用哪些选项来进行编译,任何目标平台都适用。

为目标平台构建

你可以在下面找到针对特定目标平台编译引擎的说明。请注意,Godot 支持交叉编译,也就是说你可以将其编译到与当前平台不匹配的目标平台(例如在 Windows 平台上以 Linux 平台作为目标平台)。本指南将尽力涵盖所有可能的情况。

其他构建目标和选项

还有一些通用的编译选项是需要额外设置的。比如虽然 Godot 的主代码库支持 C#/.NET,但默认情况下不会对其进行编译,这样减小了项目中用不到 C# 的用户的可执行文件大小。

下面的文章介绍了如何在类似的情况下配置构建系统,并且还涉及了一些优化技巧。