Build on Windows

Instructions for building Friction on Windows 10/11.

Requirements

CMake and Visual Studio (Build Tools) 2017 or 2019 are required.

CMake

Download the latest stable installer. Install to Program Files, do not add to PATH if asked to.

Visual Studio Build Tools

Download and install Visual Studio 2017 or 2019 Build Tools.

Get Source

We assume that you have git available:

git clone --recurse-submodules https://github.com/friction2d/friction

Keep the source updated with:

git pull && git submodule update -i --recursive

Get the SDK

The Friction SDK is required to build from source.

Download and extract, move the extracted sdk folder to the Friction source folder.

Build

Open the Visual Studio Build Tools Command Prompt.

cd to the Friction source folder.

set SDK_DIR=%cd%\sdk
set PATH=%ProgramFiles%\CMake\bin;%SDK_DIR%\bin;%PATH%

mkdir build
cd build

cmake -G "Visual Studio 15 2017" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%SDK_DIR% -DBUILD_ENGINE=OFF ..

cmake --build . --config Release

Replace Visual Studio 15 2017 with Visual Studio 16 2019 if you are using Visual Studio Build Tools 2019.