Support for Linux players using IL2CPP is available from 2019.4 onwards.
Operating systems (OS) have their own build systems which vary from one another. If you build using the headers and libraries on a particular OS, this might result in the built player not running on a different one. To address this, Unity provides a sysroot to build against which works on all supported Linux platforms.
The sysroot also allows cross-compilation support which enables you to build Linux IL2CPP from Linux, macOS and Windows.
To use the following packages, you need to install the Linux Build Support (IL2CPP) module in your Unity Editor version. Use the Unity Hub to do this. For further information, see Adding Modules to the Unity Editor.
Unity provides a toolchain package, which installs the sysroot and a toolchain, for building binaries for the target. The naming convention for these packages is:
If the host platform and architecture are the same as the target platform and architecture, shorten the name to platform and architecture.
To install a Unity toolchain package:
Host | Package |
---|---|
Linux | com.unity.toolchain.linux-x86_64 |
macOS | com.unity.toolchain.macos-x86_64-linux-x86_64 |
Windows | com.unity.toolchain.windows.x86_64-linux-x86_64 |
When you have installed your toolchain package, go to Project Settings > Player > Configuration and set the ScriptingBackend to IL2CPP.
To build your project:
Requirements: