comparison doc/build.rst @ 233:081c71d1f723

doc: add build.rst
author David Demelier <markand@malikania.fr>
date Thu, 26 Nov 2020 13:33:16 +0100
parents
children fb304a94a05c
comparison
equal deleted inserted replaced
232:085c2a02a93f 233:081c71d1f723
1 ====================
2 Building from source
3 ====================
4
5 This page will explain how to build Molko's Adventure and libraries.
6
7 Requirements
8 ------------
9
10 The following requirements are necessary to build the project.
11
12 - C11 compiler: obviously,
13 - cmake_: the build system,
14 - `SDL2`_: the main game library,
15 - `SDL2_image`_: to load images,
16 - `SDL2_mixer`_: to play sounds and music,
17 - `SDL2_ttf`_: to open fonts,
18 - `Jansson`_: only for ``mlk-tileset`` and ``mlk-map`` tools.
19
20 Platforms supported
21 -------------------
22
23 The project has been tested on the following platforms.
24
25 - Windows 10: only with `MSYS2`_, Visual Studio **is not** supported yet.
26 - macOS 11.0 (Big Sur): using Xcode 12 and libraries from `brew`_,
27 - Linux: on Alpine Linux (musl) and Arch Linux.
28
29 C and POSIX features
30 --------------------
31
32 Both of the API and the game are written using C99 and C11 but not all of the
33 features from both C versions are required. Here's a list of functionalities
34 that are required:
35
36 From C99:
37
38 - `Compound literals`_,
39 - `stdbool.h`_ header,
40 - `snprintf`_ function and friends,
41 - `inline`_ keyword.
42
43 From C11:
44
45 - `stdnoreturn.h`_ header.
46
47 From POSIX:
48
49 We use a few parts of POSIX_ specification but try to keep its use limited as
50 not all platforms are POSIX compliant.
51
52 - `getopt(3)`_: to parse arguments,
53 - We assume that ``fopen``, ``malloc`` and friends set errno in case of failures.
54
55 .. note:: When a POSIX requirement isn't present it is replaced by a shim
56 specified for the platform.
57
58 .. _Compound literals: https://en.cppreference.com/w/c/language/compound_literal
59 .. _Jansson: https://digip.org/jansson
60 .. _MSYS2: https://www.msys2.org
61 .. _POSIX: https://pubs.opengroup.org/onlinepubs/9699919799
62 .. _SDL2: http://libsdl.org
63 .. _SDL2_image: https://www.libsdl.org/projects/SDL_image
64 .. _SDL2_mixer: https://www.libsdl.org/projects/SDL_mixer
65 .. _SDL2_ttf: https://www.libsdl.org/projects/SDL_ttf
66 .. _brew: https://brew.sh
67 .. _cmake: http://cmake.org
68 .. _getopt(3): https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html
69 .. _inline: https://en.cppreference.com/w/c/language/inline
70 .. _snprintf: https://en.cppreference.com/w/c/io/fprintf
71 .. _stdbool.h: https://en.cppreference.com/w/c/language/arithmetic_types#Boolean_type
72 .. _stdnoreturn.h: https://en.cppreference.com/w/c/types