This page will explain how to build Molko's Adventure and libraries.
The following requirements are necessary to build the project.
- C11 compiler: obviously,
- CMake: the build system,
- SDL2: the main game library,
- SDL2_image: to load images,
- SDL2_mixer: to play sounds and music,
- SDL2_ttf: to open fonts,
- Jansson: only for
The project has been tested on the following platforms.
- Windows 10: only with MSYS2, Visual Studio is not supported yet.
- macOS 11.0 (Big Sur): using Xcode 12 and libraries from brew,
- Linux: on Alpine Linux (musl) and Arch Linux (glibc).
C and POSIX features
Both of the API and the game are written using C99 and C11 but not all of the features from both C versions are required. Here's a list of functionalities that are required:
- We use a few parts of POSIX specification but try to keep its use limited as not all platforms are POSIX compliant.
- We assume that
mallocand friends set errno in case of failures.
PATH_MAX: in limits.h.
When a POSIX requirement isn't present it is replaced by a shim specified for the platform.
Building with CMake
Enter the source directory and type the following commands. In this example we will use the "Unix Makefiles".
mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Debug make
If you use a CMake generator that supports configuration types (e.g. Xcode,
Visual Studio) do not set
The following CMake options are availble:
- Enable documentation (default: On).
- Build examples (default: On).
- Build tests (default: On).