IN THIS ARTICLE
Open 3D Engine on Linux
Open 3D Engine (O3DE) includes support for the Linux platform. Learn how to build O3DE tools and projects for the supported versions of Linux using the instructions included here.
The following instructions assume that you have:
- Set up O3DE in a project-centric source engine configuration from GitHub. For help, refer to Setting up O3DE from GitHub .
- Registered the O3DE engine in the O3DE manifest. If you set up O3DE from GitHub, you must manually register the engine. For help, refer to Register the engine .
- Met all Linux hardware and software requirements listed in O3DE System Requirements .
Note:These instructions use
$O3DE_ENGINEto refer to the absolute path where the O3DE source code is located on your local file system.
If you haven’t yet created an O3DE project, do so now using the
o3de script. $O3DE_PROJECT_PATH refers to the absolute path of the project and $O3DE_PROJECT_NAME refers to the name of the project.
$O3DE_ENGINE/scripts/o3de.sh create-project --project-path $O3DE_PROJECT_PATH
Refer to Creating Projects Using the Command Line Interface for more information on creating new O3DE projects.
Although CMake supports Unix Make Files on Linux, we recommend that you use Ninja as a build system to support multiple configurations in your generated builds. These instructions use “Ninja Multi-Config” as the CMake generator.
The following command generates a build folder,
build/linux, under the root of the project folder,
$O3DE_PROJECT_PATH, by using Ninja as the build generator and clang-12 as the compiler.
cd $O3DE_PROJECT_PATH cmake -B build/linux -S . -G "Ninja Multi-Config"
If you do not need to generate multi-config build folders, you can specify “Unix Makefiles” as the generator for CMake. You will need to specify a configuration at the time of project generation. Valid values for $BUILD_CONFIG include:
cd $O3DE_PROJECT_PATH cmake -B build/linux -S . -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$BUILD_CONFIG
Once the build folder is generated, building from command line is the same process as for other platforms.
When building a project that was generated using the Ninja Multi-Config generator, include the build configuration in the build command.
cd $O3DE_PROJECT_PATH cmake --build build/linux --config profile --target $O3DE_PROJECT_NAME.GameLauncher Editor
When building a project that was generated using the Unix Makefile generator, CMake will use the configuration that you specified during project generation.
cd $O3DE_PROJECT_PATH cmake --build build/linux --target $O3DE_PROJECT_NAME.GameLauncher Editor
To support code completion and other IntelliSense features found in IDEs such as Visual Studio, instruct CMake to generate a compilation database ( compile-command.json ) file as part of the project generation command.
Note:IDEs can use the
compile-command.jsononly when Unity builds are turned off. Since Unity builds are enabled by default in O3DE, you will need to explicitly turn it off with the
To enable the generation of the compilation database file, include the following arguments in the project generation command: