# Toolchain submission


To build a Player Library fully compatible with your hardware, we need to replicate your build environment. We use a standard CMake toolchain file to make sure our binaries match your toolchain, system headers, and CPU architecture. The toolchain must meet the [technical requirements](/sdk/requirements#technical): we build the Player Library in an x86-64 Linux Docker container, so your cross-compiler must run on x86-64 Linux.

## Toolchain file template

Replace the `<REPLACE_WITH_…>` placeholders with values for your environment. See the example after the template for guidance.

```cmake title="toolchain.cmake" showLineNumbers
# --- Mandatory Information ---

# Target Operating System (usually Linux)
set(CMAKE_SYSTEM_NAME <REPLACE_WITH_OS>)

# Target Architecture
set(CMAKE_SYSTEM_PROCESSOR <REPLACE_WITH_CPU_ARCH>)

# The root directory of your cross-compiler
set(TOOLCHAIN_ROOT "<REPLACE_WITH_TOOLCHAIN_ROOT>")

# Full paths to your compiler binaries
set(CMAKE_C_COMPILER "${TOOLCHAIN_ROOT}/bin/<REPLACE_WITH_C_COMPILER>")
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_ROOT}/bin/<REPLACE_WITH_CXX_COMPILER>")

# --- Optional Information ---

# Path to the target filesystem (libraries/headers)
# set(CMAKE_SYSROOT <REPLACE_WITH_SYSROOT_PATH>)

# Specific optimization or architecture flags
# set(CMAKE_C_FLAGS "<REPLACE_WITH_FLAGS>")
# set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
```

Example for a generic AArch64 (64-bit ARM) toolchain:

```cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(TOOLCHAIN_ROOT "/opt/gcc-arm-10.3-aarch64-none-linux-gnu")
set(CMAKE_C_COMPILER "${TOOLCHAIN_ROOT}/bin/aarch64-none-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_ROOT}/bin/aarch64-none-linux-gnu-g++")

set(CMAKE_C_FLAGS "-march=armv8-a")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
```

## What to send us

The most important part of this request is a tarball of the contents of `TOOLCHAIN_ROOT`. After the NDA is signed, send us the following:

- **Toolchain root**: The directory containing your compiler binaries.
- **Architecture details**: Your `CMAKE_SYSTEM_PROCESSOR`.
- **Sysroot** _(optional)_: If your system headers and libraries are located outside of `TOOLCHAIN_ROOT`, include this directory as well.
- **Specific flags** _(optional)_: Your `CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS`, if you want us to use particular optimization or hardware-specific settings when building the Player Library.

:::note
When archiving these directories on Linux, use `tar` with the `-h` flag. It follows symbolic links and stores the files they point to, so the archive has no links that break outside your machine: `tar -chzf toolchain_export.tar.gz /path/to/your/toolchain`
:::

For more technical details, see the official [CMake toolchain documentation](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html). If you have any questions or need help, email [sdk@soundtrack.io](mailto:sdk@soundtrack.io).
