| 1 |
--- |
| 2 |
title: Release 0.59.0 |
| 3 |
short-description: Release notes for 0.59.0 |
| 4 |
... |
| 5 |
|
| 6 |
# New features |
| 7 |
|
| 8 |
## Unescaped variables in pkgconfig files |
| 9 |
|
| 10 |
Spaces in variable values are escaped with `\`, this is required in the case the |
| 11 |
value is a path that and is used in `cflags` or `libs` arguments. This was an |
| 12 |
undocumented behaviour that caused issues in the case the variable is a space |
| 13 |
separated list of items. |
| 14 |
|
| 15 |
For backward compatibility reasons this behaviour could not be changed, new |
| 16 |
keyword arguments have thus been added: `unescaped_variables` and |
| 17 |
`unescaped_uninstalled_variables`. |
| 18 |
|
| 19 |
```meson |
| 20 |
pkg = import('pkgconfig') |
| 21 |
... |
| 22 |
pkg.generate(lib, |
| 23 |
variables: { |
| 24 |
'mypath': '/path/with spaces/are/escaped', |
| 25 |
}, |
| 26 |
unescaped_variables: { |
| 27 |
'mylist': 'Hello World Is Not Escaped', |
| 28 |
}, |
| 29 |
) |
| 30 |
``` |
| 31 |
|
| 32 |
## The custom_target() function now accepts a feed argument |
| 33 |
|
| 34 |
It is now possible to provide a `feed: true` argument to `custom_target()` to |
| 35 |
pipe the target's input file to the program's standard input. |
| 36 |
|
| 37 |
## Separate functions for qt preprocess |
| 38 |
|
| 39 |
`qt.preprocess` is a large, complicated function that does a lot of things, |
| 40 |
a new set of `compile_*` functions have been provided as well. These are |
| 41 |
conceptually simpler, as they do a single thing. |
| 42 |
|
| 43 |
## Cython as as first class language |
| 44 |
|
| 45 |
Meson now supports Cython as a first class language. This means you can write: |
| 46 |
|
| 47 |
```meson |
| 48 |
project('my project', 'cython') |
| 49 |
|
| 50 |
py = import('python').find_installation() |
| 51 |
dep_py = py.dependency() |
| 52 |
|
| 53 |
py.extension_module( |
| 54 |
'foo', |
| 55 |
'foo.pyx', |
| 56 |
dependencies : dep_py, |
| 57 |
) |
| 58 |
``` |
| 59 |
|
| 60 |
And avoid the step through a generator that was previously required. |
| 61 |
|
| 62 |
## Support for the Wine Resource Compiler |
| 63 |
|
| 64 |
Users can now choose `wrc` as the `windres` binary in their cross files and |
| 65 |
`windows.compile_resources` will handle it correctly. Together with `winegcc` |
| 66 |
patches in Wine 6.12 this enables basic support for compiling projects as a |
| 67 |
winelib by specifying `winegcc`/`wineg++` as the compiler and `wrc` as the |
| 68 |
resource compiler in a cross file. |
| 69 |
|
| 70 |
## New `vs2012` and `vs2013` backend options |
| 71 |
|
| 72 |
Adds the ability to generate Visual Studio 2012 and 2013 projects. This is an |
| 73 |
extension to the existing Visual Studio 2010 projects so that it is no longer |
| 74 |
required to manually upgrade the generated Visual Studio 2010 projects. |
| 75 |
|
| 76 |
Generating Visual Studio 2010 projects has also been fixed since its developer |
| 77 |
command prompt does not provide a `%VisualStudioVersion%` envvar. |
| 78 |
|
| 79 |
## Developer environment |
| 80 |
|
| 81 |
Expand the support for the `link_whole:` project option for pre-Visual Studio 2015 |
| 82 |
Update 2, where previously Visual Studio 2015 Update 2 or later was required for |
| 83 |
this, for the Ninja backend as well as the vs2010 (as well as the newly-added |
| 84 |
vs2012 and vs2013 backends). |
| 85 |
|
| 86 |
## Fs Module now accepts files objects |
| 87 |
|
| 88 |
It is now possible to define a `files()` object and run most Fs module |
| 89 |
functions on the file, rather than passing a string and hoping it is in the |
| 90 |
same directory. |
| 91 |
|
| 92 |
|
| 93 |
## Compiler argument checking for `get_supported_arguments` |
| 94 |
|
| 95 |
The compiler method `get_supported_arguments` now supports |
| 96 |
a new keyword argument named `checked` that can be set to |
| 97 |
one of `warn`, `require` or `off` (defaults to `off`) to |
| 98 |
enforce argument checks. |
| 99 |
|
| 100 |
## New custom dependency for libintl |
| 101 |
|
| 102 |
Meson can now find the library needed for translating messages via gettext. |
| 103 |
This works both on systems where libc provides gettext, such as GNU or musl, |
| 104 |
and on systems where the gettext project's standalone intl support library is |
| 105 |
required, such as macOS. |
| 106 |
|
| 107 |
Rather than doing something such as: |
| 108 |
|
| 109 |
``` |
| 110 |
intl_dep = dependency('', required: false) |
| 111 |
|
| 112 |
if cc.has_function('ngettext') |
| 113 |
intl_found = true |
| 114 |
else |
| 115 |
intl_dep = cc.find_library('intl', required: false) |
| 116 |
intl_found = intl_dep.found() |
| 117 |
endif |
| 118 |
|
| 119 |
if intl_found |
| 120 |
# build options that need gettext |
| 121 |
conf.set('ENABLE_NLS', 1) |
| 122 |
endif |
| 123 |
``` |
| 124 |
|
| 125 |
one may simply use: |
| 126 |
|
| 127 |
``` |
| 128 |
intl_dep = dependency('intl', required: false) |
| 129 |
|
| 130 |
if intl_dep.found() |
| 131 |
# build options that need gettext |
| 132 |
conf.set('ENABLE_NLS', 1) |
| 133 |
endif |
| 134 |
``` |
| 135 |
|
| 136 |
## Parallelized `meson subprojects` commands |
| 137 |
|
| 138 |
All `meson subprojects` commands are now run on each subproject in parallel by |
| 139 |
default. The number of processes can be controlled with `--num-processes` |
| 140 |
argument. |
| 141 |
|
| 142 |
This speeds up considerably IO-bound operations such as downloads and git fetch. |
| 143 |
|
| 144 |
## Using Vala no longer requires C in the project languages |
| 145 |
|
| 146 |
Meson will now add C automatically. Since the use of C is an implementation |
| 147 |
detail of Vala, Meson shouldn't require users to add it. |
| 148 |
|
| 149 |
## The `import()` function gains `required` and `disabler` arguments |
| 150 |
|
| 151 |
In addition, modules now have a `found()` method, like programs and |
| 152 |
dependencies. This allows them to be conditionally required, and used in most |
| 153 |
places that an object with a `found()` method can be. |
| 154 |
|
| 155 |
## Objective C/C++ standard versions |
| 156 |
|
| 157 |
Objective C and C++ compilations will from now on use the language |
| 158 |
versions set in `c_std` and `cpp_std`, respectively. It is not |
| 159 |
possible to set the language version separately for Objective C and |
| 160 |
plain C. |
| 161 |
|
| 162 |
## Qt.preprocess source arguments deprecated |
| 163 |
|
| 164 |
The `qt.preprocess` method currently has this signature: |
| 165 |
`qt.preprocess(name: str | None, *srcs: str)`, this is not a nice signature |
| 166 |
because it's confusing, and there's a `sources` keyword argument as well. |
| 167 |
Both of these pass sources through unmodified, this is a bit of a historical |
| 168 |
accident, and not the way that any other module works. These have been |
| 169 |
deprecated, so instead of: |
| 170 |
```meson |
| 171 |
sources = qt.preprocess( |
| 172 |
name, |
| 173 |
list, of, sources, |
| 174 |
sources : [more, sources], |
| 175 |
... # things to process, |
| 176 |
) |
| 177 |
|
| 178 |
executable( |
| 179 |
'foo', |
| 180 |
sources, |
| 181 |
) |
| 182 |
``` |
| 183 |
use |
| 184 |
```meson |
| 185 |
processed = qt.preprocess( |
| 186 |
name, |
| 187 |
... # thins to process |
| 188 |
) |
| 189 |
|
| 190 |
executable( |
| 191 |
'foo', |
| 192 |
'list', 'of', 'sources', 'more', 'sources', processed, |
| 193 |
) |
| 194 |
``` |
| 195 |
|
| 196 |
## New `build target` methods |
| 197 |
|
| 198 |
The [[@build_tgt]] object now supports |
| 199 |
the following two functions, to ensure feature compatibility with |
| 200 |
[[@external_program]] objects: |
| 201 |
|
| 202 |
- `found()`: Always returns `true`. This function is meant |
| 203 |
to make executables objects feature compatible with |
| 204 |
`external program` objects. This simplifies |
| 205 |
use-cases where an executable is used instead of an external program. |
| 206 |
|
| 207 |
- `path()`: **(deprecated)** does the exact same as `full_path()`. |
| 208 |
**NOTE:** This function is solely kept for compatibility |
| 209 |
with `external program` objects. It will be |
| 210 |
removed once the, also deprecated, corresponding `path()` function in the |
| 211 |
`external program` object is removed. |
| 212 |
|
| 213 |
## Automatically set up Visual Studio environment |
| 214 |
|
| 215 |
When Meson is run on Windows it will automatically set up the |
| 216 |
environment to use Visual Studio if no other compiler toolchain |
| 217 |
can be detected. This means that you can run Meson commands from |
| 218 |
any command prompt or directly from any IDE. This sets up the |
| 219 |
64 bit native environment. If you need any other, then you |
| 220 |
need to set it up manually as before. |
| 221 |
|
| 222 |
## `gnome.compile_schemas()` sets `GSETTINGS_SCHEMA_DIR` into devenv |
| 223 |
|
| 224 |
When using `gnome.compile_schemas()` the location of the compiled schema is |
| 225 |
added to `GSETTINGS_SCHEMA_DIR` environment variable when using |
| 226 |
[`meson devenv`](Commands.md#devenv) command. |
| 227 |
|
| 228 |
## `update_desktop_database` added to `gnome.post_install()` |
| 229 |
|
| 230 |
Applications that install a `.desktop` file containing a `MimeType` need to update |
| 231 |
the cache upon installation. Most applications do that using a custom script, |
| 232 |
but it can now be done by Meson directly. |
| 233 |
|
| 234 |
See [`gnome.post_install()`](Gnome-module.md#gnomepost_install). |