-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRelease-notes-for-0-49-0.html
501 lines (458 loc) · 19.6 KB
/
Release-notes-for-0-49-0.html
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
<!DOCTYPE html>
<html lang="en">
<head>
<base href=".">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Release 0.49</title>
<link rel="stylesheet" href="assets/css/dark-frontend.css" type="text/css" title="dark">
<link rel="alternate stylesheet" href="assets/css/light-frontend.css" type="text/css" title="light">
<link rel="stylesheet" href="assets/css/bootstrap-toc.min.css" type="text/css">
<link rel="stylesheet" href="assets/css/jquery.mCustomScrollbar.min.css">
<link rel="stylesheet" href="assets/js/search/enable_search.css" type="text/css">
<link rel="stylesheet" href="assets/css/notes.css" type="text/css">
<link rel="stylesheet" href="assets/css/prism-tomorrow.css" type="text/css" title="dark">
<link rel="alternate stylesheet" href="assets/css/prism.css" type="text/css" title="light">
<script src="assets/js/mustache.min.js"></script>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.js"></script>
<script src="assets/js/scrollspy.js"></script>
<script src="assets/js/typeahead.jquery.min.js"></script>
<script src="assets/js/search.js"></script>
<script src="assets/js/compare-versions.js"></script>
<script src="assets/js/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="assets/js/bootstrap-toc.min.js"></script>
<script src="assets/js/jquery.touchSwipe.min.js"></script>
<script src="assets/js/anchor.min.js"></script>
<script src="assets/js/tag_filtering.js"></script>
<script src="assets/js/language_switching.js"></script>
<script src="assets/js/styleswitcher.js"></script>
<script src="assets/js/lines_around_headings.js"></script>
<script src="assets/js/prism-core.js"></script>
<script src="assets/js/prism-autoloader.js"></script>
<script src="assets/js/prism_autoloader_path_override.js"></script>
<script src="assets/js/prism-keep-markup.js"></script>
<script src="assets/js/trie.js"></script>
<link rel="icon" type="image/png" href="assets/images/favicon.png">
<link rel="shortcut icon" href="assets/images/favicon.png">
</head>
<body class="no-script
">
<script>
$('body').removeClass('no-script');
</script>
<nav class="navbar navbar-fixed-top navbar-default" id="topnav">
<div class="container-fluid">
<div class="navbar-right">
<a id="toc-toggle">
<span class="glyphicon glyphicon-menu-right"></span>
<span class="glyphicon glyphicon-menu-left"></span>
</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-wrapper" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span title="light mode switch" class="glyphicon glyphicon-sunglasses pull-right" id="lightmode-icon"></span>
<form class="navbar-form pull-right" id="navbar-search-form">
<div class="form-group has-feedback">
<input type="text" class="form-control input-sm" name="search" id="sidenav-lookup-field" placeholder="search" disabled>
<span class="glyphicon glyphicon-search form-control-feedback" id="search-mgn-glass"></span>
</div>
</form>
</div>
<div class="navbar-header">
<a id="sidenav-toggle">
<span class="glyphicon glyphicon-menu-right"></span>
<span class="glyphicon glyphicon-menu-left"></span>
</a>
<a id="home-link" href="index.html" class="hotdoc-navbar-brand">
<img src="assets/images/meson_logo.png" alt="Home">
</a>
</div>
<div class="navbar-collapse collapse" id="navbar-wrapper">
<ul class="nav navbar-nav" id="menu">
<li class="dropdown">
<a class="dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Modules <span class="caret"></span>
</a>
<ul class="dropdown-menu" id="modules-menu">
<li>
<a href="CMake-module.html">CMake</a>
</li>
<li>
<a href="Cuda-module.html">CUDA</a>
</li>
<li>
<a href="Dlang-module.html">Dlang</a>
</li>
<li>
<a href="External-Project-module.html">External Project</a>
</li>
<li>
<a href="Fs-module.html">Filesystem</a>
</li>
<li>
<a href="Gnome-module.html">GNOME</a>
</li>
<li>
<a href="Hotdoc-module.html">Hotdoc</a>
</li>
<li>
<a href="i18n-module.html">i18n</a>
</li>
<li>
<a href="Icestorm-module.html">Icestorm</a>
</li>
<li>
<a href="Java-module.html">Java</a>
</li>
<li>
<a href="Keyval-module.html">Keyval</a>
</li>
<li>
<a href="Pkgconfig-module.html">Pkgconfig</a>
</li>
<li>
<a href="Python-3-module.html">Python 3</a>
</li>
<li>
<a href="Python-module.html">Python</a>
</li>
<li>
<a href="Qt4-module.html">Qt4</a>
</li>
<li>
<a href="Qt5-module.html">Qt5</a>
</li>
<li>
<a href="Qt6-module.html">Qt6</a>
</li>
<li>
<a href="Rust-module.html">Rust</a>
</li>
<li>
<a href="Simd-module.html">Simd</a>
</li>
<li>
<a href="SourceSet-module.html">SourceSet</a>
</li>
<li>
<a href="Wayland-module.html">Wayland</a>
</li>
<li>
<a href="Windows-module.html">Windows</a>
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Quick References <span class="caret"></span>
</a>
<ul class="dropdown-menu" id="quick-refs-menu">
<li>
<a href="Reference-manual.html">Functions</a>
</li>
<li>
<a href="Build-options.html">Options</a>
</li>
<li>
<a href="Configuration.html">Configuration</a>
</li>
<li>
<a href="Dependencies.html">Dependencies</a>
</li>
<li>
<a href="Unit-tests.html">Tests</a>
</li>
<li>
<a href="Syntax.html">Syntax</a>
</li>
</ul>
</li>
</ul>
<div class="hidden-xs hidden-sm navbar-text navbar-center">
<p><b>The Meson Build System</b></p>
</div>
</div>
</div>
</nav>
<main>
<div data-extension="core" data-hotdoc-in-toplevel="True" data-hotdoc-project="Meson-documentation" data-hotdoc-ref="Release-notes-for-0-49-0.html" class="page_container" id="page-wrapper">
<script src="assets/js/utils.js"></script>
<div class="panel panel-collapse oc-collapsed" id="sidenav" data-hotdoc-role="navigation">
<script src="assets/js/full-width.js"></script>
<div id="sitenav-wrapper">
<iframe src="hotdoc-sitemap.html" id="sitenav-frame"></iframe>
</div>
</div>
<div id="body">
<div id="main">
<div id="page-description" data-hotdoc-role="main">
<h1 id="new-features">New features</h1>
<h2 id="libgcrypt-dependency-now-supports-libgcryptconfig">Libgcrypt dependency now supports libgcrypt-config</h2>
<p>Earlier, <code>dependency('libgcrypt')</code> could only detect the library with
pkg-config files. Now, if pkg-config files are not found, Meson will
look for <code>libgcrypt-config</code> and if it's found, will use that to find
the library.</p>
<h2 id="new-section-key-for-the-buildoptions-introspection">New <code>section</code> key for the buildoptions introspection</h2>
<p>Meson now has a new <code>section</code> key in each build option. This allows
IDEs to group these options similar to <code>meson configure</code>.</p>
<p>The possible values for <code>section</code> are:</p>
<ul>
<li>core</li>
<li>backend</li>
<li>base</li>
<li>compiler</li>
<li>directory</li>
<li>user</li>
<li>test</li>
</ul>
<h2 id="ccrx-compiler-for-c-and-cpp">CC-RX compiler for C and CPP</h2>
<p>Cross-compilation is now supported for Renesas RX targets with the
CC-RX compiler.</p>
<p>The environment path should be set properly for the CC-RX compiler
executables. The <code>-cpu</code> option with the appropriate value should be
mentioned in the cross-file as shown in the snippet below.</p>
<pre><code class="language-ini">[properties]
c_args = ['-cpu=rx600']
cpp_args = ['-cpu=rx600']
</code></pre>
<p>The default extension of the executable output is <code>.abs</code>. Other target
specific arguments to the compiler and linker will need to be added
explicitly from the
cross-file(<code>c_args</code>/<code>c_link_args</code>/<code>cpp_args</code>/<code>cpp_link_args</code>) or some
other way. Refer to the CC-RX User's manual for additional compiler
and linker options.</p>
<h2 id="cmake-find_package-dependency-backend">CMake <code>find_package</code> dependency backend</h2>
<p>Meson can now use the CMake <code>find_package</code> ecosystem to detect
dependencies. Both the old-style <code><NAME>_LIBRARIES</code> variables as well
as imported targets are supported. Meson can automatically guess the
correct CMake target in most cases but it is also possible to manually
specify a target with the <code>modules</code> property.</p>
<pre><code class="language-meson"># Implicitly uses CMake as a fallback and guesses a target
dep1 = dependency('KF5TextEditor')
# Manually specify one or more CMake targets to use
dep2 = dependency('ZLIB', method : 'cmake', modules : ['ZLIB::ZLIB'])
</code></pre>
<p>CMake is automatically used after <code>pkg-config</code> fails when
no <code>method</code> (or <code>auto</code>) was provided in the dependency options.</p>
<h2 id="new-compiler-method-get_argument_syntax">New compiler method <code>get_argument_syntax</code>
</h2>
<p>The compiler object now has <code>get_argument_syntax</code> method, which
returns a string value of <code>gcc</code>, <code>msvc</code>, or an undefined value string
value. This can be used to determine if a compiler uses gcc syntax
(<code>-Wfoo</code>), msvc syntax (<code>/w1234</code>), or some other kind of arguments.</p>
<pre><code class="language-meson">cc = meson.get_compiler('c')
if cc.get_argument_syntax() == 'msvc'
if cc.has_argument('/w1235')
add_project_arguments('/w1235', language : ['c'])
endif
elif cc.get_argument_syntax() == 'gcc'
if cc.has_argument('-Wfoo')
add_project_arguments('-Wfoo', language : ['c'])
endif
elif cc.get_id() == 'some other compiler'
add_project_arguments('--error-on-foo', language : ['c'])
endif
</code></pre>
<h2 id="return-disabler-instead-of-notfound-object">Return <code>Disabler()</code> instead of not-found object</h2>
<p>Functions such as <code>dependency()</code>, <code>find_library()</code>, <code>find_program()</code>,
and <code>python.find_installation()</code> have a new keyword argument:
<code>disabler</code>. When set to <code>true</code> those functions return <code>Disabler()</code>
objects instead of not-found objects.</p>
<h2 id="introspect-projectinfo-can-now-be-used-without-configured-build-directory">
<code>introspect --projectinfo</code> can now be used without configured build directory</h2>
<p>This allows IDE integration to get information about the project
before the user has configured a build directory.</p>
<p>Before you could use <code>meson.py introspect --projectinfo build-directory</code>. Now you also can use <code>meson.py introspect --projectinfo project-dir/meson.build</code>.</p>
<p>The output is similar to the output with a build directory but
additionally also includes information from <code>introspect --buildsystem-files</code>.</p>
<p>For example <code>meson.py introspect --projectinfo test\ cases/common/47\ subproject\ options/meson.build</code> This outputs (pretty printed for
readability):</p>
<pre><code>{
"buildsystem_files": [
"meson_options.txt",
"meson.build"
],
"name": "suboptions",
"version": null,
"descriptive_name": "suboptions",
"subprojects": [
{
"buildsystem_files": [
"subprojects/subproject/meson_options.txt",
"subprojects/subproject/meson.build"
],
"name": "subproject",
"version": "undefined",
"descriptive_name": "subproject"
}
]
}
</code></pre>
<p>Both usages now include a new <code>descriptive_name</code> property which always
shows the name set in the project.</p>
<h2 id="can-specify-keyword-arguments-with-a-dictionary">Can specify keyword arguments with a dictionary</h2>
<p>You can now specify keyword arguments for any function and method call
with the <code>kwargs</code> keyword argument. This is perhaps best described
with an example:</p>
<pre><code class="language-meson">options = {'include_directories': include_directories('inc')}
...
executable(...
kwargs: options)
</code></pre>
<p>The above code is identical to this:</p>
<pre><code class="language-meson">executable(...
include_directories: include_directories('inc'))
</code></pre>
<p>That is, Meson will expand the dictionary given to <code>kwargs</code> as if the
entries in it had been given as keyword arguments directly.</p>
<p>Note that any individual argument can be specified either directly or
with the <code>kwarg</code> dict but not both. If a key is specified twice, it
is a hard error.</p>
<h2 id="manpages-are-no-longer-compressed-implicitly">Manpages are no longer compressed implicitly</h2>
<p>Earlier, the <code>install_man</code> command has automatically compressed
installed manpages into <code>.gz</code> format. This collided with manpage
compression hooks already used by various distributions. Now, manpages
are installed uncompressed and distributors are expected to handle
compressing them according to their own compression preferences.</p>
<h2 id="native-config-files">Native config files</h2>
<p>Native files (<code>--native-file</code>) are the counterpart to cross files
(<code>--cross-file</code>), and allow specifying information about the build
machine, both when cross compiling and when not.</p>
<p>Currently the native files only allow specifying the names of
binaries, similar to the cross file, for example:</p>
<pre><code class="language-ini">[binaries]
llvm-config = "/opt/llvm-custom/bin/llvm-config"
</code></pre>
<p>Will override the llvm-config used for <em>native</em> binaries. Targets for
the host machine will continue to use the cross file.</p>
<h2 id="foreach-break-and-continue">Foreach <code>break</code> and <code>continue</code>
</h2>
<p><code>break</code> and <code>continue</code> keywords can be used inside foreach loops.</p>
<pre><code class="language-meson">items = ['a', 'continue', 'b', 'break', 'c']
result = []
foreach i : items
if i == 'continue'
continue
elif i == 'break'
break
endif
result += i
endforeach
# result is ['a', 'b']
</code></pre>
<p>You can check if an array contains an element like this:</p>
<pre><code class="language-meson">my_array = [1, 2]
if 1 in my_array
# This condition is true
endif
if 1 not in my_array
# This condition is false
endif
</code></pre>
<p>You can check if a dictionary contains a key like this:</p>
<pre><code class="language-meson">my_dict = {'foo': 42, 'foo': 43}
if 'foo' in my_dict
# This condition is true
endif
if 42 in my_dict
# This condition is false
endif
if 'foo' not in my_dict
# This condition is false
endif
</code></pre>
<h2 id="joining-paths-with-">Joining paths with /</h2>
<p>For clarity and conciseness, we recommend using the <code>/</code> operator to separate
path elements:</p>
<pre><code class="language-meson">joined = 'foo' / 'bar'
</code></pre>
<p>Before Meson 0.49, joining path elements was done with the legacy
<code>join_paths</code> function, but the <code>/</code> syntax above is now recommended.</p>
<pre><code class="language-meson">joined = join_paths('foo', 'bar')
</code></pre>
<p>This only works for strings.</p>
<h2 id="positionindependent-executables">Position-independent executables</h2>
<p>When <code>b_pie</code> option, or <code>executable()</code>'s <code>pie</code> keyword argument is set
to <code>true</code>, position-independent executables are built. All their
objects are built with <code>-fPIE</code> and the executable is linked with
<code>-pie</code>. Any static library they link must be built with <code>pic</code> set to
<code>true</code> (see <code>b_staticpic</code> option).</p>
<h2 id="deprecation-warning-in-pkgconfig-generator">Deprecation warning in pkg-config generator</h2>
<p>All libraries passed to the <code>libraries</code> keyword argument of the
<code>generate()</code> method used to be associated with that generated
pkg-config file. That means that any subsequent call to <code>generate()</code>
where those libraries appear would add the filebase of the
<code>generate()</code> that first contained them into <code>Requires:</code> or
<code>Requires.private:</code> field instead of adding an <code>-l</code> to <code>Libs:</code> or
<code>Libs.private:</code>.</p>
<p>This behaviour is now deprecated. The library that should be
associated with the generated pkg-config file should be passed as
first positional argument instead of in the <code>libraries</code> keyword
argument. The previous behaviour is maintained but prints a
deprecation warning and support for this will be removed in a future
Meson release. If you cannot create the needed pkg-config file
without this warning, please file an issue with as much details as
possible about the situation.</p>
<p>For example this sample will write <code>Requires: liba</code> into <code>libb.pc</code> but
print a deprecation warning:</p>
<pre><code class="language-meson">liba = library(...)
pkg.generate(libraries : liba)
libb = library(...)
pkg.generate(libraries : [liba, libb])
</code></pre>
<p>It can be fixed by passing <code>liba</code> as first positional argument::</p>
<pre><code class="language-meson">liba = library(...)
pkg.generate(liba)
libb = library(...)
pkg.generate(libb, libraries : [liba])
</code></pre>
<h2 id="subprojects-download-checkout-update-commandline">Subprojects download, checkout, update command-line</h2>
<p>New command-line tool has been added to manage subprojects:</p>
<ul>
<li>
<code>meson subprojects download</code> to download all subprojects that have a wrap file.</li>
<li>
<code>meson subprojects update</code> to update all subprojects to latest version.</li>
<li>
<code>meson subprojects checkout</code> to checkout or create a branch in all git subprojects.</li>
</ul>
<h2 id="new-keyword-argument-is_default-to-add_test_setup">New keyword argument <code>is_default</code> to <code>add_test_setup()</code>
</h2>
<p>The keyword argument <code>is_default</code> may be used to set whether the test
setup should be used by default whenever <code>meson test</code> is run without
the <code>--setup</code> option.</p>
<pre><code class="language-meson">add_test_setup('default', is_default: true, env: 'G_SLICE=debug-blocks')
add_test_setup('valgrind', env: 'G_SLICE=always-malloc', ...)
test('mytest', exe)
</code></pre>
<p>For the example above, running <code>meson test</code> and <code>meson test --setup=default</code> is now equivalent.</p>
</div>
</div>
<div id="search_results">
<p>The results of the search are</p>
</div>
<div id="footer">
<hr>
<div class="license-description">
Website licensing information are available on the <a href="legal.html">Legal</a> page.
</div>
</div>
</div>
<div id="toc-column">
<div class="edit-button">
<a href="https://github.com/mesonbuild/meson/edit/master/docs/markdown/Release-notes-for-0.49.0.md" data-hotdoc-role="edit-button">Edit on GitHub</a>
</div>
<div id="toc-wrapper">
<nav id="toc"></nav>
</div>
</div>
</div>
</main>
<script src="assets/js/navbar_offset_scroller.js"></script>
</body>
</html>