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.

为 Linux、*BSD 平台编译

参见

这个页面描述的是如何从源码编译 Linux 编辑器和导出模板二进制文件。如果你要找的是导出项目到 Linux,请阅读 为 Linux 导出

需求

要在Linux或其他类Unix系统下进行编译, 需要满足以下条件:

  • GCC 7+ 或 Clang 6+.

  • Python 3.6+.

  • SCons 3.0+ 构建系统.

    备注

    If your distribution uses Python 2 by default, or you are using a version of SCons prior to 3.1.2, you will need to change the version of Python that SCons uses by changing the shebang (the first line) of the SCons script file to #! /usr/bin/python3. Use the command which scons to find the location of the SCons script file.

  • pkg-config (used to detect the development libraries listed below).

  • ALSA 开发库:

    • X11, Xcursor, Xinerama, Xi and XRandR.

    • MesaGL.

    • ALSA.

    • 音频。

  • 可选——libudev(使用 udev = yes 构建)。

参见

要获取编译所需的 Godot 源码,请参阅 获取源代码

有关 Godot 的 SCons 用法的一般概述,请参阅 构建系统介绍

针对各个发行版的单行命令

apk add \
  scons \
  pkgconf