1MESON(1) User Commands MESON(1)
2
3
4
6 meson - a high productivity build system
7
9 Meson is a build system designed to optimize programmer productivity.
10 It aims to do this by providing simple, out-of-the-box support for mod‐
11 ern software development tools and practices, such as unit tests, cov‐
12 erage reports, Valgrind, CCache and the like.
13
14 The main Meson executable provides many subcommands to access all the
15 functionality.
16
17
19 Using Meson is simple and follows the common two-phase process of most
20 build systems. First you run Meson to configure your build:
21
22 meson setup [ options ] [ source directory ] [ build directory ]
23
24 Note that the build directory must be different from the source direc‐
25 tory. Meson does not support building inside the source directory and
26 attempting to do that leads to an error.
27
28 After a successful configuration step you can build the source by run‐
29 ning the actual build command in the build directory. The default back‐
30 end of Meson is Ninja, which can be invoked like this.
31
32 ninja [ target ]
33
34 You only need to run the Meson command once: when you first configure
35 your build dir. After that you just run the build command. Meson will
36 autodetect changes in your source tree and regenerate all files needed
37 to build the project.
38
39 The setup command is the default operation. If no actual command is
40 specified, Meson will assume you meant to do a setup. That means that
41 you can set up a build directory without the setup command like this:
42
43 meson [ options ] [ source directory ] [ build directory ]
44
45
46 options:
47 --version
48 print version number
49
50 --help print command line help
51
52
54 meson configure provides a way to configure a Meson project from the
55 command line. Its usage is simple:
56
57 meson configure [ build directory ] [ options to set ]
58
59 If build directory is omitted, the current directory is used instead.
60
61 If no parameters are set, meson configure will print the value of all
62 build options to the console.
63
64 To set values, use the -D command line argument like this.
65
66 meson configure -Dopt1=value1 -Dopt2=value2
67
68
70 Meson introspect is a command designed to make it simple to integrate
71 with other tools, such as IDEs. The output of this command is in JSON.
72
73 meson introspect [ build directory ] [ option ]
74
75 If build directory is omitted, the current directory is used instead.
76
77
78 options:
79 --targets
80 print all top level targets (executables, libraries, etc)
81
82 --target-files
83 print the source files of the given target
84
85 --buildsystem-files
86 print all files that make up the build system (meson.build,
87 meson_options.txt etc)
88
89 --tests
90 print all unit tests
91
92 --help print command line help
93
94
96 meson test is a helper tool for running test suites of projects using
97 Meson. The default way of running tests is to invoke the default build
98 command:
99
100 ninja [ test ]
101
102 meson test provides a richer set of tools for invoking tests.
103
104
105 options:
106 --repeat
107 run tests as many times as specified
108
109 --gdb run tests under gdb
110
111 --list list all available tests
112
113 --wrapper
114 invoke all tests via the given wrapper (e.g. valgrind)
115
116 -C Change into the given directory before running tests (must be
117 root of build directory).
118
119 --suite
120 run tests in this suite
121
122 --no-suite
123 do not run tests in this suite
124
125 --no-stdsplit
126 do not split stderr and stdout in test logs
127
128 --benchmark
129 run benchmarks instead of tests
130
131 --logbase
132 base of file name to use for writing test logs
133
134 --num-processes
135 how many parallel processes to use to run tests
136
137 --verbose
138 do not redirect stdout and stderr
139
140 -t a multiplier to use for test timeout values (usually something
141 like 100 for Valgrind)
142
143 --setup
144 use the specified test setup
145
146
148 Wraptool is a helper utility to manage source dependencies using the
149 online wrapdb service.
150
151 meson wrap < command > [ options ]
152
153 You should run this command in the top level source directory of your
154 project.
155
156
157 Commands:
158 list list all available projects
159
160 search search projects by name
161
162 install
163 install a project with the given name
164
165 update update the specified project to latest available version
166
167 info show available versions of the specified project
168
169 status show installed and available versions of currently used subpro‐
170 jects
171
172
174 0 Successful.
175
176 1 Usage error, or an error parsing or executing meson.build.
177
178 2 Internal error.
179
180
181
182 SEE ALSO
183
184 http://mesonbuild.com/
185
186 https://wrapdb.mesonbuild.com/
187
188
189
190meson 0.50.1 April 2019 MESON(1)