forked from freeciv/freeciv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.meson
191 lines (138 loc) · 6.78 KB
/
INSTALL.meson
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
==============================
Installing Freeciv with Meson:
==============================
This file describes how to compile and install Freeciv with the
Meson build system support. The other supported way to compile and
install Freeciv is using autotools as described in INSTALL.
Prerequisites:
==============
Freeciv has mostly the same prerequisites no matter if it's built
with autotools or meson and ninja. The only difference is the requirement
of the build system itself. Meson build does not need autotools, nor does
autotools build need meson. See main (autotools) INSTALL file for the
common prerequisites.
For the meson based build minimum version of meson is 0.57.0.
Overview:
=========
There's two parts in building freeciv. First one needs to configure the
build, and then execute it.
Build directory is configured with the 'meson' command. This is equivalent
of running './configure' in autotools based system. Meson does not allow
configuring the source directory. It always requires separate build directory.
Just create an empty directory, cd in to it, and run meson with path to
source directory as parameter. You can also give configure options in this
phase.
> mkdir build ; cd build
> meson setup ../freeciv-3.1.0
You need to configure the build directory just once. As source files get
updated, you can just execute incremental builds in the build directory.
You can have multiple build directories configured to use the same source
directory, typically set up with different configure options. You can
for example have separate build directories for different kinds of clients.
The build is executed with 'ninja' command. This is equivalent of running
'make' in autotools based system. It's also used to install freeciv
> ninja
> ninja install
Configure options:
==================
Configure options are given as '-D<option>=<value>'.
For example to set freeciv installation prefix as
'/home/cazfi/freeciv-install':
> meson setup ../src -Dprefix=/home/cazfi/freeciv-install
You can give configure options when you first set up the build directory
(like in example above), or you can change configure options for the
build directory later by 'meson configure' subcommand like this:
> meson configure -Dprefix=/home/cazfi/freeciv-install
You get full list of configure options by running 'meson configure'
subcommand without any configure options to set
> meson configure
Some of the configure options are implemented by meson itself for
all meson-based projects. Some options are implemented in freeciv build
system, and they are specific to freeciv.
Notable generic configure options:
----------------------------------
prefix (string):
The directory where Freeciv will be installed. You can install multiple
versions of Freeciv in parallel by using different prefix for each.
It's also a good idea to use prefix to avoid messing your system directories
debug (boolean):
Whether debug version of Freeciv should be built. While this is generic
option, some functionality in Freeciv depends on this setting.
default_library ('shared'/'static'/'both')
In case of freeciv, this affects build of common libfreeciv library.
The default is to build shared library, and as the binaries then
need to find the shared library at their run time, setting
system up for that may require some extra work. If one uses
this setting to build static library instead, it's going to be
included in the binaries themselves, so they don't need to find it.
Freeciv specific configure options:
-----------------------------------
clients (array):
List of clients to build. To disable client build completely, give an
empty array ('-Dclients=[]'). Currently gtk3.22-, sdl2-, qt-,
gtk4-, and stub-client builds are supported.
By default builds just gtk3.22-client.
fcmp (array):
List of freeciv modpack installer UIs to build. To disable their build
completely, give an empty array ('-Dfcmp=[]'). Currently gtk3, qt, gtk4,
and cli are supported. By default builds just gtk3 UI.
cacert-path (string):
Custom path to CA cert bundle. If this is empty, default path will be used.
This affects mostly downloading custom modpacks with modpack installer from
an 'https' URL.
json-protocol (boolean):
Build json-protocol support in. Json-protocol is an alternative to the default
raw-protocol between freeciv server and client.
syslua ('try'/'true'/'false')
Whether to use lua from the system, or to build lua included in freeciv
source tree. The default is 'try' to use lua from the system if possible,
but fallback to using freeciv's included one if not found from system.
sys-tolua-cmd (boolean):
Whether to use tolua command from the system, or to build one
included in the freeciv source tree. For native build
the default is false, i.e., to use freeciv's own tolua.
When cross-compiling, this setting is ignored, and tolua is
always used from the build system.
mwand ('try'/'true'/'false')
Whether to build against MagickWand to have support for additional
mapimg formats. The default is 'try' to enable the support if possible.
readline ('try'/'true'/'false')
Whether to enable readline functionality on server.
The default is 'try' to enable it if suitable readline found.
audio (boolean):
Build sound support to the clients. Defaults to true.
ruledit (boolean):
Build ruleset editor. Defaults to true.
nls (boolean):
Build in Native Language Support. Defaults to true.
gitrev (boolean):
Include git commit id to the version string.
freeciv-web (boolean):
Build freeciv-web version instead of normal one.
gen-packets-args (array):
Aditional packet generator arguments passed to common/generate_packets.py.
qtver ('qt5'/'qt6'/'qt6x'):
Whether to build Qt5, Qt6, or experimental Qt6 versions of the binaries.
project-definition (string):
Filename of the project definition to use. See below for contents of
such a file
min-win-ver (string):
Minimum Windows version the build should support. Versions listed on
https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
Project definition file
-----------------------
Each line of project definition line must have keyword in the beginning,
separated by a space from the rest of the line containing the value.
There's an example file bootstrap/freeciv.fcproj
Supported keys:
META_URL - URL of the default metaserver
MODPACK_LIST_URL - URL of the default modpack list
FREECIV_STORAGE_DIR - Directory where freeciv stores user files
FREECIV_DEFAULT_POR - Default port of the server
run.sh
------
One of the build results is script named 'run.sh' in the build directory -
it does not get installed to the installation directory. This script can
be used to run freeciv executables from the build directory.
Give the executable name and parameters as parameters to ./run.sh, e.g.,
./run.sh freeciv-server --help