-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRelease-notes-for-0-50-0.html
518 lines (481 loc) · 22.3 KB
/
Release-notes-for-0-50-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
509
510
511
512
513
514
515
516
517
518
<!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.50.0</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-50-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="added-cmake_module_path-and-cmake_args-to-dependency">Added <code>cmake_module_path</code> and <code>cmake_args</code> to dependency</h2>
<p>The CMake dependency backend can now make use of existing
<code>Find<name>.cmake</code> files by setting the <code>CMAKE_MODULE_PATH</code> with the
new <code>dependency()</code> property <code>cmake_module_path</code>. The paths given to
<code>cmake_module_path</code> should be relative to the project source
directory.</p>
<p>Furthermore the property <code>cmake_args</code> was added to give CMake
additional parameters.</p>
<h2 id="added-pgi-compiler-support">Added PGI compiler support</h2>
<p>Nvidia / PGI C, C++ and Fortran
<a href="https://www.pgroup.com/products/community.htm">no-cost</a> compilers are
now supported. They have been tested on Linux so far.</p>
<h2 id="fortran-coarray">Fortran Coarray</h2>
<p>Fortran 2008 / 2018 coarray support was added via <code>dependency('coarray')</code></p>
<h2 id="libdir-defaults-to-lib-when-cross-compiling">Libdir defaults to <code>lib</code> when cross compiling</h2>
<p>Previously <code>libdir</code> defaulted to the value of the build machine such
as <code>lib/x86_64-linux-gnu</code>, which is almost always incorrect when cross
compiling. It now defaults to plain <code>lib</code> when cross compiling. Native
builds remain unchanged and will point to the current system's library
dir.</p>
<h2 id="native-and-cross-file-paths-and-directories">Native and Cross File Paths and Directories</h2>
<p>A new <code>[paths]</code> section has been added to native and cross files. This
can be used to set paths such a prefix and libdir in a persistent way.</p>
<h2 id="add-warning_level-0-option">Add warning_level 0 option</h2>
<p>Adds support for a warning level 0 which does not enable any static
analysis checks from the compiler</p>
<h2 id="a-builtin-target-to-run-clangformat">A builtin target to run clang-format</h2>
<p>If you have <code>clang-format</code> installed and there is a <code>.clang-format</code>
file in the root of your master project, Meson will generate a run
target called <code>clang-format</code> so you can reformat all files with one
command:</p>
<pre><code class="language-meson">ninja clang-format
</code></pre>
<h2 id="added-path-method-to-object-returned-by-pythonfind_installation">Added <code>.path()</code> method to object returned by <code>python.find_installation()</code>
</h2>
<p><code>ExternalProgram</code> objects as well as the object returned by the
<code>python3</code> module provide this method, but the new <code>python</code> module did
not.</p>
<h2 id="fix-ninja-console-log-from-generators-with-multiple-output-nodes">Fix ninja console log from generators with multiple output nodes</h2>
<p>This resolves <a href="https://github.com/mesonbuild/meson/issues/4760">issue
#4760</a> where a
generator with multiple output nodes printed an empty string to the
console</p>
<h2 id="introspect-buildoptions-can-now-be-used-without-configured-build-directory">
<code>introspect --buildoptions</code> can now be used without configured build directory</h2>
<p>It is now possible to run <code>meson introspect --buildoptions /path/to/meson.build</code>
without a configured build directory.</p>
<p>Running <code>--buildoptions</code> without a build directory produces the same
output as running it with a freshly configured build directory.</p>
<p>However, this behavior is not guaranteed if subprojects are
present. Due to internal limitations all subprojects are processed
even if they are never used in a real Meson run. Because of this
options for the subprojects can differ.</p>
<h2 id="include_directories-accepts-a-string">
<code>include_directories</code> accepts a string</h2>
<p>The <code>include_directories</code> keyword argument now accepts plain strings
rather than an include directory object. Meson will transparently
expand it so that a declaration like this:</p>
<pre><code class="language-meson">executable(..., include_directories: 'foo')
</code></pre>
<p>Is equivalent to this:</p>
<pre><code class="language-meson">foo_inc = include_directories('foo')
executable(..., include_directories: foo_inc)
</code></pre>
<h2 id="fortran-submodule-support">Fortran submodule support</h2>
<p>Initial support for Fortran <code>submodule</code> was added, where the submodule
is in the same or different file than the parent <code>module</code>. The
submodule hierarchy specified in the source Fortran code <code>submodule</code>
statements are used by Meson to resolve source file dependencies. For
example:</p>
<pre><code class="language-fortran">submodule (ancestor:parent) child
</code></pre>
<h2 id="add-subproject_dir-to-projectinfo-introspection-output">Add <code>subproject_dir</code> to <code>--projectinfo</code> introspection output</h2>
<p>This allows applications interfacing with Meson (such as IDEs) to know
about an overridden subproject directory.</p>
<h2 id="find-library-with-its-headers">Find library with its headers</h2>
<p>The <code>find_library()</code> method can now also verify if the library's
headers are found in a single call, using the <code>has_header()</code> method
internally.</p>
<pre><code class="language-meson"># Aborts if the 'z' library is found but not its header file
zlib = find_library('z', has_headers : 'zlib.h')
# Returns not-found if the 'z' library is found but not its header file
zlib = find_library('z', has_headers : 'zlib.h', required : false)
</code></pre>
<p>Any keyword argument with the <code>header_</code> prefix passed to
<code>find_library()</code> will be passed to the <code>has_header()</code> method with the
prefix removed.</p>
<pre><code class="language-meson">libfoo = find_library('foo',
has_headers : ['foo.h', 'bar.h'],
header_prefix : '#include <baz.h>',
header_include_directories : include_directories('.'))
</code></pre>
<h2 id="netcdf">NetCDF</h2>
<p>NetCDF support for C, C++ and Fortran is added via pkg-config.</p>
<h2 id="added-the-flang-compiler">Added the Flang compiler</h2>
<p><a href="https://github.com/flang-compiler/flang/releases">Flang</a> Fortran
compiler support was added. As with other Fortran compilers, flang is
specified using <code>FC=flang meson ..</code> or similar.</p>
<h2 id="new-not_found_message-for-dependency">New <code>not_found_message</code> for <code>dependency()</code>
</h2>
<p>You can now specify a <code>not_found_message</code> that will be printed if the
specified dependency was not found. The point is to convert constructs
that look like this:</p>
<pre><code class="language-meson">d = dependency('something', required: false)
if not d.found()
message('Will not be able to do something.')
endif
</code></pre>
<p>Into this:</p>
<pre><code class="language-meson">d = dependency('something',
required: false,
not_found_message: 'Will not be able to do something.')
</code></pre>
<p>Or constructs like this:</p>
<pre><code class="language-meson">d = dependency('something', required: false)
if not d.found()
error('Install something by doing XYZ.')
endif
</code></pre>
<p>into this:</p>
<pre><code class="language-meson">d = dependency('something',
not_found_message: 'Install something by doing XYZ.')
</code></pre>
<p>Which works, because the default value of <code>required</code> is <code>true</code>.</p>
<h2 id="cuda-support">Cuda support</h2>
<p>Compiling Cuda source code is now supported, though only with the
Ninja backend. This has been tested only on Linux for now.</p>
<p>Because NVidia's Cuda compiler does not produce <code>.d</code> dependency files,
dependency tracking does not work.</p>
<h2 id="run_command-accepts-env-kwarg">
<code>run_command()</code> accepts <code>env</code> kwarg</h2>
<p>You can pass <a href="Reference-manual_returned_env.html"><ins><code>env</code></ins></a>
object to <a href="Reference-manual_functions.html#run_command"><ins><code>run_command()</code></ins></a>, just
like to <code>test</code>:</p>
<pre><code class="language-meson">env = environment()
env.set('FOO', 'bar')
run_command('command', 'arg1', 'arg2', env: env)
</code></pre>
<h2 id="extract_objects-accepts-file-arguments">
<code>extract_objects:</code> accepts <code>File</code> arguments</h2>
<p>The <code>extract_objects</code> function now supports File objects to tell it
what to extract. Previously, file paths could only be passed as strings.</p>
<h2 id="changed-the-json-format-of-the-introspection">Changed the JSON format of the introspection</h2>
<p>All paths used in the Meson introspection JSON format are now
absolute. This affects the <code>filename</code> key in the targets introspection
and the output of <code>--buildsystem-files</code>.</p>
<p>Furthermore, the <code>filename</code> and <code>install_filename</code> keys in the targets
introspection are now lists of strings with identical length.</p>
<p>The <code>--target-files</code> option is now deprecated, since the same information
can be acquired from the <code>--targets</code> introspection API.</p>
<h2 id="meson-file-rewriter">Meson file rewriter</h2>
<p>This release adds the functionality to perform some basic modification
on the <code>meson.build</code> files from the command line. The currently
supported operations are:</p>
<ul>
<li>For build targets:
<ul>
<li>Add/Remove source files</li>
<li>Add/Remove targets</li>
<li>Modify a select set of kwargs</li>
<li>Print some JSON information</li>
</ul>
</li>
<li>For dependencies:
<ul>
<li>Modify a select set of kwargs</li>
</ul>
</li>
<li>For the project function:
<ul>
<li>Modify a select set of kwargs</li>
<li>Modify the default options list</li>
</ul>
</li>
</ul>
<p>For more information see the rewriter documentation.</p>
<h2 id="introspect-scandependencies-can-now-be-used-to-scan-for-dependencies-used-in-a-project">
<code>introspect --scan-dependencies</code> can now be used to scan for dependencies used in a project</h2>
<p>It is now possible to run <code>meson introspect --scan-dependencies /path/to/meson.build</code> without a configured build directory to scan for
dependencies.</p>
<p>The output format is as follows:</p>
<pre><code class="language-json">[
{
"name": "The name of the dependency",
"required": true,
"conditional": false,
"has_fallback": false
}
]
</code></pre>
<p>The <code>required</code> keyword specifies whether the dependency is marked as
required in the <code>meson.build</code> (all dependencies are required by
default). The <code>conditional</code> key indicates whether the <code>dependency()</code>
function was called inside a conditional block. In a real Meson run
these dependencies might not be used, thus they <em>may</em> not be required,
even if the <code>required</code> key is set. The <code>has_fallback</code> key just
indicates whether a fallback was directly set in the <code>dependency()</code>
function.</p>
<h2 id="introspect-targets-can-now-be-used-without-configured-build-directory">
<code>introspect --targets</code> can now be used without configured build directory</h2>
<p>It is now possible to run <code>meson introspect --targets /path/to/meson.build</code> without a configured build directory.</p>
<p>The generated output is similar to running the introspection with a
build directory. However, there are some key differences:</p>
<ul>
<li>The paths in <code>filename</code> now are <em>relative</em> to the future build directory</li>
<li>The <code>install_filename</code> key is completely missing</li>
<li>There is only one entry in <code>target_sources</code>:
<ul>
<li>With the language set to <code>unknown</code>
</li>
<li>Empty lists for <code>compiler</code> and <code>parameters</code> and <code>generated_sources</code>
</li>
<li>The <code>sources</code> list <em>should</em> contain all sources of the target</li>
</ul>
</li>
</ul>
<p>There is no guarantee that the sources list in <code>target_sources</code> is
correct. There might be differences, due to internal limitations. It
is also not guaranteed that all targets will be listed in the output.
It might even be possible that targets are listed, which won't exist
when Meson is run normally. This can happen if a target is defined
inside an if statement. Use this feature with care.</p>
<h2 id="added-option-to-introspect-multiple-parameters-at-once">Added option to introspect multiple parameters at once</h2>
<p>Meson introspect can now print the results of multiple introspection
commands in a single call. The results are then printed as a single
JSON object.</p>
<p>The format for a single command was not changed to keep backward
compatibility.</p>
<p>Furthermore the option <code>-a,--all</code>, <code>-i,--indent</code> and
<code>-f,--force-object-output</code> were added to print all introspection
information in one go, format the JSON output (the default is still
compact JSON) and force use the new output format, even if only one
introspection command was given.</p>
<p>A complete introspection dump is also stored in the <code>meson-info</code>
directory. This dump will be (re)generated each time meson updates the
configuration of the build directory.</p>
<p>Additionally the format of <code>meson introspect target</code> was changed:</p>
<ul>
<li>New: the <code>sources</code> key. It stores the source files of a target and their compiler parameters.</li>
<li>New: the <code>defined_in</code> key. It stores the Meson file where a target is defined</li>
<li>New: the <code>subproject</code> key. It stores the name of the subproject where a target is defined.</li>
<li>Added new target types (<code>jar</code>, <code>shared module</code>).</li>
</ul>
<h2 id="meson-configure-can-now-print-the-default-options-of-an-unconfigured-project">
<code>meson configure</code> can now print the default options of an unconfigured project</h2>
<p>With this release, it is also possible to get a list of all build
options by invoking <code>meson configure</code> with the project source
directory or the path to the root <code>meson.build</code>. In this case, Meson
will print the default values of all options.</p>
<h2 id="hdf5">HDF5</h2>
<p>HDF5 support is added via pkg-config.</p>
<h2 id="added-the-mesoninfojson-introspection-file">Added the <code>meson-info.json</code> introspection file</h2>
<p>Meson now generates a <code>meson-info.json</code> file in the <code>meson-info</code>
directory to provide introspection information about the latest Meson
run. This file is updated when the build configuration is changed and
the build files are (re)generated.</p>
<h2 id="new-kwarg-install-for-configure_file">New kwarg <code>install:</code> for <code>configure_file()</code>
</h2>
<p>Previously when using <code>configure_file()</code>, you could install the
outputted file by setting the <code>install_dir:</code> keyword argument. Now,
there is an explicit kwarg <code>install:</code> to enable/disable it. Omitting
it will maintain the old behaviour.</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.50.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>