-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRelease-notes-for-0-46-0.html
508 lines (468 loc) · 22.3 KB
/
Release-notes-for-0-46-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
502
503
504
505
506
507
508
<!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.46</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-46-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="allow-early-return-from-a-script">Allow early return from a script</h2>
<p>Added the function <code>subdir_done()</code>. Its invocation exits the current
script at the point of invocation. All previously invoked build
targets and commands are build/executed. All following ones are
ignored. If the current script was invoked via <code>subdir()</code> the parent
script continues normally.</p>
<h2 id="log-output-slightly-changed">Log output slightly changed</h2>
<p>The format of some human-readable diagnostic messages has changed in
minor ways. In case you are parsing these messages, you may need to
adjust your code.</p>
<h2 id="arm-compiler-for-c-and-cpp">ARM compiler for C and CPP</h2>
<p>Cross-compilation is now supported for ARM targets using ARM compiler</p>
<ul>
<li>ARMCC. The current implementation does not support shareable
libraries. The default extension of the output is .axf. The
environment path should be set properly for the ARM compiler
executables. The '--cpu' option with the appropriate target type
should be mentioned in the cross file as shown in the snippet below.</li>
</ul>
<pre><code class="language-ini">[properties]
c_args = ['--cpu=Cortex-M0plus']
cpp_args = ['--cpu=Cortex-M0plus']
</code></pre>
<h2 id="building-both-shared-and-static-libraries">Building both shared and static libraries</h2>
<p>A new function <code>both_libraries()</code> has been added to build both shared
and static libraries at the same time. Source files will be compiled
only once and object files will be reused to build both shared and
static libraries, unless <code>b_staticpic</code> user option or <code>pic:</code> keyword
argument are set to false in which case sources will be compiled
twice.</p>
<p>The returned <code>buildtarget</code> object always represents the shared library.</p>
<h2 id="compiler-object-can-now-be-passed-to-run_command">Compiler object can now be passed to run_command()</h2>
<p>This can be used to run the current compiler with the specified
arguments to obtain additional information from it. One of the use
cases is to get the location of development files for the GCC plugins:</p>
<pre><code class="language-meson">cc = meson.get_compiler('c')
result = run_command(cc, '-print-file-name=plugin')
plugin_dev_path = result.stdout().strip()
</code></pre>
<h2 id="declare_dependency-now-supports-link_whole">declare_dependency() now supports <code>link_whole:</code>
</h2>
<p><code>declare_dependency()</code> now supports the <code>link_whole:</code> keyword argument which
transparently works for build targets which use that dependency.</p>
<h2 id="old-command-names-are-now-errors">Old command names are now errors</h2>
<p>The old executable names <code>mesonintrospect</code>, <code>mesonconf</code>,
<code>mesonrewriter</code> and <code>mesontest</code> have been deprecated for a long time.
Starting from this version they no longer do anything but instead
always error out. All functionality is available as subcommands in the
main <code>meson</code> binary.</p>
<h2 id="meson-and-meson-configure-now-accept-the-same-arguments">Meson and meson configure now accept the same arguments</h2>
<p>Previously Meson required that builtin arguments (like prefix) be
passed as <code>--prefix</code> to <code>meson</code> and <code>-Dprefix</code> to <code>meson configure</code>.
<code>meson</code> now accepts -D form like <code>meson configure</code> has. <code>meson configure</code> also accepts the <code>--prefix</code> form, like <code>meson</code> has.</p>
<h2 id="recursively-extract-objects">Recursively extract objects</h2>
<p>The <code>recursive:</code> keyword argument has been added to
<code>extract_all_objects()</code>. When set to <code>true</code> it will also return
objects passed to the <code>objects:</code> argument of this target. By default
only objects built for this target are returned to maintain backward
compatibility with previous versions. The default will eventually be
changed to <code>true</code> in a future version.</p>
<pre><code class="language-meson">lib1 = static_library('a', 'source.c', objects : 'prebuilt.o')
lib2 = static_library('b', objects : lib1.extract_all_objects(recursive : true))
</code></pre>
<h2 id="can-override-find_program">Can override find_program()</h2>
<p>It is now possible to override the result of <code>find_program</code> to point
to a custom program you want. The overriding is global and applies to
every subproject from there on. Here is how you would use it.</p>
<p>In master project</p>
<pre><code class="language-meson">subproject('mydep')
</code></pre>
<p>In the called subproject:</p>
<pre><code class="language-meson">prog = find_program('my_custom_script')
meson.override_find_program('mycodegen', prog)
</code></pre>
<p>In master project (or, in fact, any subproject):</p>
<pre><code class="language-meson">genprog = find_program('mycodegen')
</code></pre>
<p>Now <code>genprog</code> points to the custom script. If the dependency had come
from the system, then it would point to the system version.</p>
<p>You can also use the return value of <code>configure_file()</code> to override
a program in the same way as above:</p>
<pre><code class="language-meson">prog_script = configure_file(input : 'script.sh.in',
output : 'script.sh',
configuration : cdata)
meson.override_find_program('mycodegen', prog_script)
</code></pre>
<h2 id="new-functions-has_link_argument-and-friends">New functions: has_link_argument() and friends</h2>
<p>A new set of methods has been added to <a href="Reference-manual_returned_compiler.html"><ins><code>compiler</code></ins></a>
objects to test if the linker
supports given arguments.</p>
<ul>
<li><a href="Reference-manual_returned_compiler.html#compilerhas_link_argument"><ins><code>compiler.has_link_argument()</code></ins></a></li>
<li><a href="Reference-manual_returned_compiler.html#compilerhas_multi_link_arguments"><ins><code>compiler.has_multi_link_arguments()</code></ins></a></li>
<li><a href="Reference-manual_returned_compiler.html#compilerget_supported_link_arguments"><ins><code>compiler.get_supported_link_arguments()</code></ins></a></li>
<li><a href="Reference-manual_returned_compiler.html#compilerfirst_supported_link_argument"><ins><code>compiler.first_supported_link_argument()</code></ins></a></li>
</ul>
<h2 id="meson-help-now-shows-command-line-help">"meson help" now shows command line help</h2>
<p>Command line parsing is now less surprising. "meson help" is now
equivalent to "meson --help" and "meson help <subcommand>" is
equivalent to "meson <subcommand> --help", instead of creating a build
directory called "help" in these cases.</subcommand></subcommand></p>
<h2 id="autogeneration-of-simple-mesonbuild-files">Autogeneration of simple meson.build files</h2>
<p>A feature to generate a meson.build file compiling given C/C++ source
files into a single executable has been added to "meson init". By
default, it will take all recognizable source files in the current
directory. You can also specify a list of dependencies with the -d
flag and automatically invoke a build with the -b flag to check if the
code builds with those dependencies.</p>
<p>For example,</p>
<pre><code class="language-meson">meson init -fbd sdl2,gl
</code></pre>
<p>will look for C or C++ files in the current directory, generate a
meson.build for them with the dependencies of sdl2 and gl and
immediately try to build it, overwriting any previous meson.build and
build directory.</p>
<h2 id="install_data-supports-rename">install_data() supports <code>rename:</code>
</h2>
<p>The <code>rename:</code> keyword argument is used to change names of the installed
files. Here's how you install and rename the following files:</p>
<ul>
<li>
<code>file1.txt</code> into <code>share/myapp/dir1/data.txt</code>
</li>
<li>
<code>file2.txt</code> into <code>share/myapp/dir2/data.txt</code>
</li>
</ul>
<pre><code class="language-meson">install_data(['file1.txt', 'file2.txt'],
rename : ['dir1/data.txt', 'dir2/data.txt'],
install_dir : 'share/myapp')
</code></pre>
<h2 id="support-for-lcc-compiler-for-e2k-elbrus-architecture">Support for lcc compiler for e2k (Elbrus) architecture</h2>
<p>In this version, a support for lcc compiler for Elbrus processors
based on <a href="https://en.wikipedia.org/wiki/Elbrus_2000">e2k
microarchitecture</a> has been
added.</p>
<p>Examples of such CPUs:</p>
<ul>
<li>
<a href="https://en.wikipedia.org/wiki/Elbrus-8S">Elbrus-8S</a>;</li>
<li>Elbrus-4S;</li>
<li>
<a href="https://en.wikipedia.org/wiki/Elbrus-2S%2B">Elbrus-2S+</a>.</li>
</ul>
<p>Such compiler have a similar behavior as gcc (basic option compatibility),
but, in is not strictly compatible with gcc as of current version.</p>
<p>Major differences as of version 1.21.22:</p>
<ul>
<li>it does not support LTO and PCH;</li>
<li>it suffers from the same dependency file creation error as icc;</li>
<li>it has minor differences in output, especially version output;</li>
<li>it differently reacts to lchmod() detection;</li>
<li>some backend messages are produced in ru_RU.KOI8-R even if LANG=C;</li>
<li>its preprocessor treats some characters differently.</li>
</ul>
<p>So every noted difference is properly handled now in Meson.</p>
<h2 id="string-escape-character-sequence-update">String escape character sequence update</h2>
<p>Single-quoted strings in Meson have been taught the same set of escape
sequences as in Python. It is therefore now possible to use arbitrary
bytes in strings, like for example <code>NUL</code> (<code>\0</code>) and other ASCII
control characters. See the chapter about <a href="Syntax.html#strings"><em>Strings</em> in
<em>Syntax</em></a> for more details.</p>
<p>Potential backwards compatibility issue: Any valid escape sequence
according to the new rules will be interpreted as an escape sequence
instead of the literal characters. Previously only the following
escape sequences were supported in single-quote strings: <code>\'</code>, <code>\\</code>
and <code>\n</code>.</p>
<p>Note that the behaviour of triple-quoted (multiline) strings has not
changed. They behave like raw strings and do not support any escape
sequences.</p>
<h2 id="new-forcefallback-wrap-mode">New <code>forcefallback</code> wrap mode</h2>
<p>A new wrap mode was added, <code>--wrap-mode=forcefallback</code>. When this is
set, dependencies for which a fallback was provided will always use
it, even if an external dependency exists and satisfies the version
requirements.</p>
<h2 id="relaxing-of-target-name-requirements">Relaxing of target name requirements</h2>
<p>In earlier versions of Meson you could only have one target of a given
name for each type. For example you could not have two executables
named <code>foo</code>. This requirement is now relaxed so that you can have
multiple targets with the same name, as long as they are in different
subdirectories.</p>
<p>Note that projects that have multiple targets with the same name can
not be built with the <code>flat</code> layout or any backend that writes outputs
in the same directory.</p>
<h2 id="addition-of-openmp-dependency">Addition of OpenMP dependency</h2>
<p>An OpenMP dependency (<code>openmp</code>) has been added that encapsulates the
various flags used by compilers to enable OpenMP and checks for the
existence of the <code>omp.h</code> header. The <code>language</code> keyword may be passed
to force the use of a specific compiler for the checks.</p>
<h2 id="added-new-partial_dependency-method-to-dependencies-and-libraries">Added new partial_dependency method to dependencies and libraries</h2>
<p>It is now possible to use only part of a dependency in a target. This
allows, for example, to only use headers with convenience libraries to
avoid linking to the same library multiple times.</p>
<pre><code class="language-meson">dep = dependency('xcb')
helper = static_library(
'helper',
['helper1.c', 'helper2.c'],
dependencies : dep.partial_dependency(includes : true),
]
final = shared_library(
'final',
['final.c'],
dependencies : dep,
)
</code></pre>
<p>A partial dependency will have the same name version as the full
dependency it is derived from, as well as any values requested.</p>
<h2 id="improved-generation-of-pkgconfig-files-for-static-only-libraries">Improved generation of pkg-config files for static only libraries.</h2>
<p>Previously pkg-config files generated by the pkgconfig modules for
static libraries with dependencies could only be used in a
dependencies with <code>static: true</code>.</p>
<p>Now the generated file contains the needed dependencies libraries
directly within <code>Requires</code> and <code>Libs</code> for build static libraries
passed via the <code>libraries</code> keyword argument.</p>
<p>Projects that install both a static and a shared version of a library
should use the result of
<a href="Reference-manual_functions.html#both_libraries"><ins><code>both_libraries()</code></ins></a> to the
pkg-config file generator or use
<a href="Reference-manual_functions.html#configure_file"><ins><code>configure_file()</code></ins></a> for more
complicated setups.</p>
<h2 id="improvements-to-pkgconfig-module">Improvements to pkgconfig module</h2>
<p>A <code>StaticLibrary</code> or <code>SharedLibrary</code> object can optionally be passed
as first positional argument of the <code>generate()</code> method. If one is provided a
default value will be provided for all required fields of the pc file:</p>
<ul>
<li>
<code>install_dir</code> is set to <code>pkgconfig</code> folder in the same location than the provided library.</li>
<li>
<code>description</code> is set to the project's name followed by the library's name.</li>
<li>
<code>name</code> is set to the library's name.</li>
</ul>
<p>Generating a .pc file is now as simple as:</p>
<pre><code class="language-meson">pkgconfig.generate(mylib)
</code></pre>
<h2 id="pkgconfiggenerate-requires-parameters-nonstring-arguments">pkgconfig.generate() requires parameters non-string arguments</h2>
<p><code>pkgconfig.generate()</code> <code>requires:</code> and <code>requires_private:</code> keyword
arguments now accept pkgconfig-dependencies and libraries that
pkgconfig-files were generated for.</p>
<h2 id="generic-python-module">Generic python module</h2>
<p>Meson now has is a revamped and generic (python 2 and 3) version of
the python3 module. With <a href="Python-module.html">this new interface</a>,
projects can now fully specify the version of python they want to
build against / install sources to, and can do so against multiple
major or minor versions in parallel.</p>
<h2 id="test-now-supports-the-depends-keyword-argument">test() now supports the <code>depends:</code> keyword argument</h2>
<p>Build targets and custom targets can be listed in the <code>depends:</code>
keyword argument of test function. These targets will be built before
test is run even if they have <code>build_by_default : false</code>.</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.46.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>