-
Notifications
You must be signed in to change notification settings - Fork 2
/
HOW_TO_COMPILE.txt
138 lines (92 loc) · 3.33 KB
/
HOW_TO_COMPILE.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
== Dependencies
Required:
- CMake 3.0.0
- A C++11 conformant compiler.
- OpenGL headers (Package 'libgl1-mesa-dev' on Debian)
Android Build: currently unsupported
- Android SDK Tools 20131030 or higher (https://developer.android.com/sdk/index.html)
- Android NDK r9 or higher (http://developer.android.com/tools/sdk/ndk/index.html)
Built if needed:
- SDL 2.0.5
- SDL_image 2.0.1
- SDL_mixer 2.0.1
- freetype 2.6.3 (may work with lesser)
- glew 2.0
Indirectly built if needed:
- libpng-dev 1.6.3 # when building SDL_image
- zlib1g-dev 1.2.8 # when building libpng
Optional:
- libvorbis-dev ## For ogg loading when building SDL_mixer
Embedded Libraries:
- glm 0.9.8.1 # Header only library
Compatible compilers:
- g++ 5.4.0 or higher
- clang 3.8 (maybe lesser)
- Microsoft Visual Studio 2015 or newer
=
For Windows, you can use vcpkg to automatically
download and install SDL.
It's located at git://github.com/Microsoft/vcpkg.git
== Controlling what is Built
The following CMake variables changes what is built.
- UGDK_BUILD_TESTS ## automated tests
- UGDK_INTERNAL_FREETYPE ## build and link against the embedded freetype
- UGDK_INTERNAL_GLEW ## build and link against the embedded glew
- UGDK_INTERNAL_SDL2 ## build and link against the embedded SDL2
- UGDK_INTERNAL_SDL2_IMAGE ## build and link against the embedded SDL2_image
- UGDK_INTERNAL_SDL2_MIXER ## build and link against the embedded SDL2_mixer
== Build instructions
Considering the dependencies listed above satisfied.
---------
GNU/Linux:
Open a terminal on the directory containing this file and execute:
$ mkdir build && cd build
$ cmake ..
$ make
Try using either 'ccmake' or 'cmake-gui' for an interactive interface to control CMake variables.
---------
Windows:
Open the CMake GUI.
Choose as the 'Where is the source code' to be the path to the directory containing this file.
Click on Add Entry and create a FILEPATH variable named CMAKE_TOOLCHAIN_FILE and
assert it's value to \vcpkg\scripts\buildsystems\vcpkg.cmake.
Choose any path for 'Build the binaries'.
---------
Android:
Set the enviroment variable ANDROID_NDK to the directory you installed the Android NDK.
Open a terminal on the directory containing this file and execute:
$ mkdir build && cd build
$ cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=../cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=android-9 ..
$ make
---------------
OLD, tofix?
=========
Mac OS X: outdated
=========
1) Install CMake 2.8 or a higher version
2) Install the following libraries:
- SDL 1.2
- SDL_Image 1.2
- SDL_Mixer 1.2
- SDL_TTF 2.0
3) Open a terminal in the same folder of this file.
4a) If you want to compile a Universal Binary for distribution:
$ cmake -DUNIVERSAL=y . (Do not forget the '.' at the end)
$ make
4b) If you only want to run the library at your Mac:
$ cmake . (Do not forget the '.' at the end)
$ make
Optionally, you can use CMake to generate files for your favorite IDE. Search
for cmake -G options.
=======
Windows
=======
1) Have the following software installed:
- CMake 3.8.0 or higher
2) Set the SDL2DIR variable to a folder that contains a include and a lib directories,
containing the following libraries:
- SDL 2.0.5
- SDL_Image 2.0.1
- SDL_Mixer 2.0.1
3) Using CMake, generate the project files for the IDE you wish to use.
4) Build using the generated project.