Skip to content

Latest commit

 

History

History
121 lines (95 loc) · 2.93 KB

BUILD.md

File metadata and controls

121 lines (95 loc) · 2.93 KB

Build Friction

Generic instructions for building Friction on supported systems.

Requirements on Linux

  • pkg-config
  • ninja
  • python3
  • cmake (3.12+)
  • clang (7+)
  • Qt (5.15.x)
    • Gui
    • Widgets
    • OpenGL
    • Multimedia
    • Qml
    • Xml
  • qscintilla
  • ffmpeg (4.2.x)
    • libavformat
    • libavcodec
    • libavutil
    • libswscale
    • libswresample
  • libunwind
  • expat
  • harfbuzz
  • freetype
  • fontconfig
  • libjpeg-turbo
  • libpng
  • libwebp
  • zlib
  • icu

Requirements on Windows

Binary SDK available here.

Requirements on macOS

  • macOS Monterey 12.7 x86-64
  • Xcode 14.2 (Apple clang 14)

Install required packages from macports:

sudo port install qt5-qtbase qt5-qttools qt5-qtmultimedia qt5-qtdeclarative qscintilla-qt5 ffmpeg pkgconfig ninja

Notes

  • FFmpeg in macports is not supported (render issues), a custom Portfile or build will be made available.
  • python and python3 must be available in PATH and point to a Python 3 install.

Get Source

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

or

git clone --recurse-submodules https://codeberg.org/friction/friction

Build on Linux

mkdir build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
..

Note that on some configurations you may need to specify qscintilla paths:

-DQSCINTILLA_INCLUDE_DIRS=<PATH_TO_QSCINTILLA_INCLUDE_DIR> \
-DQSCINTILLA_LIBRARIES_DIRS=<PATH_TO_LIBS> \
-DQSCINTILLA_LIBRARIES=<QSCINTILLA_LIBRARY_NAME> \

Now build:

cmake --build . --config Release

Build on Windows

All requirements must be installed in the correct folders, this is an example and should be adjusted to fit your environment.

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat"

set SDK_DIR=%cd%\sdk
set PATH=C:\Python;%ProgramFiles%\CMake\bin;%ProgramFiles%\Git\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% ..

cmake --build . --config Release