Linux Build Notes - o3de/wikicollection GitHub Wiki

Prerequisites

Check this page: Open 3D Engine on Linux

Note: The list of packages needed to build may be expanded/revised, but the list should give a good starting point.

Note: Users have been able to use a more recent version of Clang (versions 10-12).

Note: The following example uses Ninja (sudo apt-get install ninja).

Generating

Customize the following script to your environment.

#!/bin/env bash
C_COMPILER=clang-10
CXX_COMPILER=clang++-10
LY_3RDPARTY_PATH=${HOME}/.o3de/3rdParty
LY_PROJECTS="AutomatedTesting"
O3DE_PATH=${HOME}/Code/o3de

# CMake Configure
cmake -B ${O3DE_PATH}/build/linux_ninja -S ${O3DE_PATH} -G "Ninja Multi-Config" -DCMAKE_C_COMPILER="${C_COMPILER}" -DCMAKE_CXX_COMPILER="${CXX_COMPILER}" -DLY_3RDPARTY_PATH="${LY_3RDPARTY_PATH}" -DLY_PROJECTS="${LY_PROJECTS}" -DLY_UNITY_BUILD=1 "$@"

Building

Customize the following script to your environment.

#!/bin/env bash
O3DE_PATH=${HOME}/Code/o3de

# CMake Build (Profile)
cmake --build ${O3DE_PATH}/build/linux_ninja --config profile --target Editor AssetProcessor AutomatedTesting.GameLauncher -- "$@"

Usage

Save the code blocks above to script files (*.sh) and customize them (namely: O3DE_PATH, LY_3RDPARTY_PATH, and your specific C/CXX compiler)

Also make the files executable:

$ chmod +x generate.sh
$ chmod +x build.sh

Call the scripts, pass in additional parameters:

$ ./generate.sh
$ ./generate.sh -DMY_CMAKE_VARIABLE=TRUE
$ ./build.sh
$ ./build.sh -j 8