Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

为 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 \
  gcc \
  g++ \
  libx11-dev \
  libxcursor-dev \