| 1 |
--- |
| 2 |
title: Release 0.38 |
| 3 |
short-description: Release notes for 0.38 |
| 4 |
... |
| 5 |
|
| 6 |
## Uninstall target |
| 7 |
|
| 8 |
Meson allows you to uninstall an install step by invoking the |
| 9 |
uninstall target. This will remove all files installed as part of |
| 10 |
install. Note that this does not restore the original files. This also |
| 11 |
does not undo changes done by custom install scripts (because they can |
| 12 |
do arbitrary install operations). |
| 13 |
|
| 14 |
## Support for arbitrary test setups |
| 15 |
|
| 16 |
Sometimes you need to run unit tests with special settings. For |
| 17 |
example under Valgrind. Usually this requires extra command line |
| 18 |
options for the tool. This is supported with the new *test setup* |
| 19 |
feature. For example to set up a test run with Valgrind, you'd write |
| 20 |
this in a `meson.build` file: |
| 21 |
|
| 22 |
```meson |
| 23 |
add_test_setup('valgrind', |
| 24 |
exe_wrapper : [vg, '--error-exitcode=1', '--leak-check=full'], |
| 25 |
timeout_multiplier : 100) |
| 26 |
``` |
| 27 |
|
| 28 |
This tells Meson to run tests with Valgrind using the given options |
| 29 |
and multiplying the test timeout values by 100. To run this test setup |
| 30 |
simply issue the following command: |
| 31 |
|
| 32 |
```console |
| 33 |
$ mesontest --setup=valgrind |
| 34 |
``` |
| 35 |
|
| 36 |
## Intel C/C++ compiler support |
| 37 |
|
| 38 |
As usual, just set `CC=icc CXX=icpc` and Meson will use it as the |
| 39 |
C/C++ compiler. Currently only Linux is supported. |
| 40 |
|
| 41 |
## Get values from configuration data objects |
| 42 |
|
| 43 |
Now it is possible to query values stored in configuration data |
| 44 |
objects. |
| 45 |
|
| 46 |
```meson |
| 47 |
cdata.set('key', 'value') |
| 48 |
cdata.get('key') # returns 'value' |
| 49 |
cdata.get('nokey', 'default') # returns 'default' |
| 50 |
cdata.get('nokey') # halts with an error |
| 51 |
``` |
| 52 |
|
| 53 |
## Python 3 module support |
| 54 |
|
| 55 |
Building Python 3 extension modules has always been possible, but it |
| 56 |
is now even easier: |
| 57 |
|
| 58 |
```meson |
| 59 |
py3_mod = import('python3') |
| 60 |
pylib = py3_mod.extension_module('modname', |
| 61 |
'modsource.c', |
| 62 |
dependencies : py3_dep) |
| 63 |
``` |
| 64 |
|
| 65 |
## Default options to subprojects |
| 66 |
|
| 67 |
Projects can specify overriding values for subprojects' |
| 68 |
`default_options` when invoking a subproject: |
| 69 |
|
| 70 |
```meson |
| 71 |
subproject('foo', default_options : ['optname=overridevalue']) |
| 72 |
dependency('some-dep', fallback : ['some_subproject', 'some_dep'], default_options : ['optname=overridevalue']) |
| 73 |
``` |
| 74 |
|
| 75 |
The effect is the same as if the default options were written in the |
| 76 |
subproject's `project` call. |
| 77 |
|
| 78 |
## Set targets to be built (or not) by default |
| 79 |
|
| 80 |
Build targets got a new keyword `build_by_default` which tells whether |
| 81 |
the target should be built by default when running e.g. `ninja`. |
| 82 |
Custom targets are not built by default but other targets are. Any |
| 83 |
target that is tagged as installed or to be built always is also built |
| 84 |
by default, regardless of the value of this keyword. |
| 85 |
|
| 86 |
## Add option to mesonconf to wipe cached data. |
| 87 |
|
| 88 |
Meson caches the results of dependency lookups. Sometimes these may |
| 89 |
get out of sync with the system state. Mesonconf now has a |
| 90 |
`--clearcache` option to clear these values so they will be |
| 91 |
re-searched from the system upon next compile. |
| 92 |
|
| 93 |
## Can specify file permissions and owner when installing data |
| 94 |
|
| 95 |
The new `install_mode` keyword argument can be used to specify file |
| 96 |
permissions and uid/gid of files when doing the install. This allows |
| 97 |
you to, for example, install suid root scripts. |
| 98 |
|
| 99 |
## `has_header()` checks are now faster |
| 100 |
|
| 101 |
When using compilers that implement the [`__has_include()` |
| 102 |
preprocessor |
| 103 |
macro](https://clang.llvm.org/docs/LanguageExtensions.html#include-file-checking-macros), |
| 104 |
the check is now ~40% faster. |
| 105 |
|
| 106 |
## Array indexing now supports fallback values |
| 107 |
|
| 108 |
The second argument to the array |
| 109 |
[[list.get]] function is now returned |
| 110 |
if the specified index could not be found |
| 111 |
|
| 112 |
```meson |
| 113 |
array = [10, 11, 12, 13] |
| 114 |
array.get(0) # this will return `10` |
| 115 |
array.get(4) # this will give an error about invalid index |
| 116 |
array.get(4, 0) # this will return `0` |
| 117 |
``` |
| 118 |
|
| 119 |
## Silent mode for Mesontest |
| 120 |
|
| 121 |
The Meson test executor got a new argument `-q` (and `--quiet`) that |
| 122 |
suppresses all output of successful tests. This makes interactive |
| 123 |
usage nicer because only errors are printed. |