Building from Source
Prerequisites
Section titled “Prerequisites”- C++ compiler — GCC 13+, Clang 16+, or MSVC 2022
- CMake 3.26+
- Vulkan SDK 1.3+ — Download
- Git
git clone https://github.com/contextgg/mortar.gitcd mortarMortar uses CMake presets:
cmake --preset defaultcmake --build --preset defaultThis builds in build/default/. The binary is build/default/mortar.
Platform Notes
Section titled “Platform Notes”Install Vulkan SDK and development packages:
# Ubuntu/Debiansudo apt install libvulkan-dev vulkan-tools libx11-dev libxrandr-dev libxi-dev
# Fedorasudo dnf install vulkan-loader-devel vulkan-tools libX11-devel libXrandr-devel libXi-develInstall the Vulkan SDK from LunarG. MoltenVK is used for Vulkan-on-Metal translation.
Windows
Section titled “Windows”Install the Vulkan SDK. Visual Studio 2022 with C++ workload is required.
Open a Developer Command Prompt:
cmake --preset defaultcmake --build --preset default --config Release./build/default/mortar --map path/to/map.jsonCMake Options
Section titled “CMake Options”| Option | Default | Description |
|---|---|---|
MORTAR_ENABLE_VALIDATION | ON (Debug) | Enable Vulkan validation layers |
MORTAR_BUILD_TESTS | OFF | Build unit tests |
cmake --preset default -DMORTAR_BUILD_TESTS=ONcmake --build --preset default --target tests