Building from Source
Prerequisites
Section titled “Prerequisites”- C++ compiler — GCC 13+, Clang 16+, or MSVC 2022
- CMake 3.24+
- vcpkg — Install guide
- Vulkan SDK 1.3+ — Download
- Git
git clone https://github.com/contextgg/mortar.gitcd mortarMortar uses CMake presets with vcpkg for dependency management. Set VCPKG_ROOT to your vcpkg installation:
export VCPKG_ROOT=/path/to/vcpkgcmake --preset defaultcmake --build build -j$(nproc)The binary is build/mortar.
Platform Notes
Section titled “Platform Notes”Install Vulkan and X11 development packages:
# Ubuntu/Debiansudo apt install libvulkan-dev vulkan-tools \ libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
# Fedorasudo dnf install vulkan-loader-devel vulkan-tools \ libX11-devel libXrandr-devel libXinerama-devel libXcursor-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:
set VCPKG_ROOT=C:\path\to\vcpkgcmake --preset defaultcmake --build build --config Release./build/mortar --map path/to/map.jsonWithout --map, the engine loads a default test scene.
CMake 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 build --target tests