comparison doc/docs/install.md @ 239:d47e70da760e

doc: switch to mkdocs+doxybook2, closes #2516 @2h
author David Demelier <markand@malikania.fr>
date Fri, 27 Nov 2020 17:00:30 +0100
parents
children d7e5e02f70a1
comparison
equal deleted inserted replaced
238:b30c3af37a01 239:d47e70da760e
1 # Installation
2
3 This page will explain how to build Molko's Adventure and libraries.
4
5 ## Requirements
6
7 The following requirements are necessary to build the project.
8
9 - C11 compiler: obviously,
10 - [CMake][]: the build system,
11 - [SDL2][]: the main game library,
12 - [SDL2_image][]: to load images,
13 - [SDL2_mixer][]: to play sounds and music,
14 - [SDL2_ttf][]: to open fonts,
15 - [Jansson][]: only for `mlk-tileset` and `mlk-map` tools.
16
17 ## Platforms supported
18
19 The project has been tested on the following platforms.
20
21 - Windows 10: only with [MSYS2][], Visual Studio **is not** supported yet.
22 - macOS 11.0 (Big Sur): using Xcode 12 and libraries from [brew][],
23 - Linux: on Alpine Linux (musl) and Arch Linux (glibc).
24
25 ## C and POSIX features
26
27 Both of the API and the game are written using C99 and C11 but not all of the
28 features from both C versions are required. Here's a list of functionalities
29 that are required:
30
31 ### From C99
32
33 Features:
34
35 - [Compound literals][]
36 - [inline] keyword
37
38 Headers:
39
40 - [stdbool.h][]
41
42 Functions:
43
44 - [snprintf][]
45 - [vsnprintf][]
46
47 ### From C11
48
49 - [stdnoreturn.h][]
50
51 ### From POSIX
52
53 Expectations:
54
55 - We use a few parts of [POSIX][] specification but try to keep its use limited
56 as not all platforms are POSIX compliant.
57 - We assume that `fopen`, `malloc` and friends set errno in case of failures.
58
59 Functions:
60
61 - [dirname][]
62 - [getopt][]
63
64 Headers:
65
66 - [libgen.h][]
67
68 Macros:
69
70 - `PATH_MAX`: in limits.h.
71
72 !!! note
73 When a POSIX requirement isn't present it is replaced by a shim
74 specified for the platform.
75
76 ## Building with CMake
77
78 Enter the source directory and type the following commands. In this example we
79 will use the "Unix Makefiles".
80
81 mkdir build
82 cd build
83 cmake .. -DCMAKE_BUILD_TYPE=Debug
84 make
85
86 !!! note
87 If you use a CMake generator that supports configuration types (e.g. Xcode,
88 Visual Studio) do not set `CMAKE_BUILD_TYPE`.
89
90 ### Available options
91
92 The following CMake options are availble:
93
94 `MOLKO_WITH_DOC`
95 : Enable documentation (default: On).
96
97 `MOLKO_WITH_EXAMPLES`
98 : Build examples (default: On).
99
100 `MOLKO_WITH_TESTS`
101 : Build tests (default: On).
102
103 [CMake]: http://cmake.org
104 [Compound literals]: https://en.cppreference.com/w/c/language/compound_literal
105 [Jansson]: https://digip.org/jansson
106 [MSYS2]: https://www.msys2.org
107 [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799
108 [SDL2]: http://libsdl.org
109 [SDL2_image]: https://www.libsdl.org/projects/SDL_image
110 [SDL2_mixer]: https://www.libsdl.org/projects/SDL_mixer
111 [SDL2_ttf]: https://www.libsdl.org/projects/SDL_ttf
112 [brew]: https://brew.sh
113 [dirname]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/dirname.html
114 [getopt]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html
115 [inline]: https://en.cppreference.com/w/c/language/inline
116 [libgen.h]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/libgen.h.html
117 [snprintf]: https://en.cppreference.com/w/c/io/fprintf
118 [vsnprintf]: https://en.cppreference.com/w/c/io/fprintf
119 [stdbool.h]: https://en.cppreference.com/w/c/language/arithmetic_types#Boolean_type
120 [stdnoreturn.h]: https://en.cppreference.com/w/c/types