New features (in development)
Custom dependency for atomic now works on MSVC
dependency('atomic') now works on MSVC >=19.35.32124.
It requires c_std=c11 or later, otherwise the dependency will return not found.
New "clippy-json" Ninja Target For rust-analyzer
A new clippy-json ninja target will now be generated for rust projects.
rust-analyzer supports non-cargo based projects so long as you provide it with a rust-project.json file and a custom "check command" to provide compiler errors. Meson already for some time has generated a rust-project.json file for rust-analyzer, but had no way to hook up its rustc/clippy output to rust-analyzer.
To use the new feature, you need to override the rust-analyzer check command as shown in the rust-analyzer documentation, and set it to a ninja invocation along the lines ofninja clippy-json -C build`.
fs.copyfile() now has a build_subdir argument
fs.copyfile()'s new build_subdir argument allows creating a file
inside a subdirectory of the current build directory.
Added depends kwarg to generator.process()
The generator.process() method now supports specifying depends as a kwarg
to extend the list of dependencies for generated files.
Added integer base conversions to str.to_int() and int.to_string()
Meson strings can now be converted from hexadecimal, octal, and binary
integer literals with str.to_int(). Integers can also be formatted back to
strings in those bases with int.to_string(format:).
assert('0xff'.to_int() == 255)
assert(255.to_string(format: 'hex') == '0xff')
meson format allows --recursive with --check-diff
Previously, the --recursive option to meson format required
either --inplace or --output. With this version, --check-diff
is allowed to.
New option --subprojects for meson format
A new option --subprojects, to be specified together with --recursive,
tells meson format to also recurse into subprojects.
Support for Python 3.7, 3.8, and 3.9 dropped
Meson 1.12 is the first version to require Python version 3.10 or greater.
Support for older versions of Python is maintained with bug fixes only for some LTS releases. See the FAQ entry for more information.
Non-default members of Cargo workspaces can now be built
The new keyword argument extra_members to the workspace() method
allows configuring non-default members of a Cargo workspace. Previously,
non-default members were never used for dependency resolution and
could not be built.
meson test now accepts --exclude
meson test has a new --exclude argument to allow skipping named
tests. It takes a full test name and can be specified repeatedly. This
should help distributions that need to skip tests irrelevant for them
or known to be buggy.
werror=true now applies to the linker as well
When werror=true is set, Meson now passes the appropriate
fatal-warnings flag to the linker (for example --fatal-warnings
for GNU ld, -fatal_warnings for Apple ld, /WX for MSVC link).
Previously, werror=true only affected compiler warnings.
i18n.xgettext recursive option now includes "private" dependencies
Suppose we have:
libA.dll -> libB.dll -> libC.dll
Here, libA links with libB, and libB links with libC, but libA does
not link with libC directly. So, libC is a "private" dependency of libB.
If we collect strings to translate using:
i18n.xgettext(libC)
i18n.xgettext(libB)
pot_file = i18n.xgettext(libA, recursive: true)
Previously, strings from libC would not be included in pot_file, since
libC is not a direct link dependency of libA. This has been fixed: when
the recursive: true option is used, xgettext now recursively includes
translations from all dependencies, including those of dependencies. This is
more logical, as even if libA does not directly link with libC, it may
still need translated strings from libC.
The results of the search are