title: Release 1.4.0 short-description: Release notes for 1.4.0 ...
Meson 1.4.0 was released on 12 March 2024
[[@build_tgt]]
, [[@custom_tgt]]
, and [[@custom_idx]]
to certain FS module functionsSupport for [[@build_tgt]]
, [[@custom_tgt]]
, and [[@custom_idx]]
was added to the following FS module APIs:
fs.name
fs.parent
fs.replace_suffix
fs.stem
CMake subprojects configured by meson will now have their project version set to the project version in their CMakeLists.txt. This allows version constraints to be properly checked when falling back to a cmake subproject.
ndebug
setting now controls C++ stdlib assertionsThe ndebug
setting, if disabled, now passes preprocessor defines to enable debugging assertions within the C++ standard library.
For GCC, -D_GLIBCXX_ASSERTIONS=1
is set.
For Clang, -D_GLIBCXX_ASSERTIONS=1
is set to cover libstdc++ usage, and -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
or -D_LIBCPP_ENABLE_ASSERTIONS=1
is used depending on the Clang version.
stldebug
gains Clang supportFor Clang, we now pass -D_GLIBCXX_DEBUG=1
if debugstl
is enabled, and we also pass -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG
.
unset()
method on environment
objects[[@env]] now has an [[env.unset]] method to ensure an existing environment is not defined.
full_path()
methodReturns a full path pointing to the file. This is useful for printing the path with e.g [[message]] function for debugging purpose.
NOTE: In most cases using the object itself will do the same job as this and will also allow Meson to setup dependencies correctly.
Support for dependency('numpy')
was added, via supporting the numpy-config
tool and pkg-config support, both of which are available since NumPy 2.0.0.
Config-tool support is useful because it will work out of the box when numpy
is installed, while the pkg-config file is located inside python's site-packages, which makes it impossible to use in an out of the box manner without setting PKG_CONFIG_PATH
.
depends
kwarg now supported by compiler.preprocess()It is now possible to specify the dependent targets with depends:
for compiler.preprocess(). These targets should be built before the preprocessing starts.
preserve_paths
keyword argument to qt module functions.In qt4
, qt5
, and qt6
modules, compile_ui
, compile_moc
, and preprocess
functions now have a preserve_paths
keyword argument.
If 'true
, it specifies that the output files need to maintain their directory structure inside the target temporary directory. For instance, when a file called subdir/one.input
is processed it generates a file {target private directory}/subdir/one.out
when true
, and {target private directory}/one.out
when false
(default).
Bindgen natively assumes that a file with the extension .hpp
is a C++ header, but that everything else is a C header. Meson has a whole list of extensions it considers to be C++, and now will automatically look for those extensions and set bindgen to treat those as C++
Even though Meson will now tell bindgen to do the right thing in most cases, there may still be cases where Meson does not have the intended behavior, specifically with headers with a .h
suffix, but are C++ headers.
Which is very important for C++ bindings.
Sanitizers like MemorySanitizer do not abort by default on detected violations. Meson now exports MSAN_OPTIONS
(in addition to ASAN_OPTIONS
and UBSAN_OPTIONS
from a previous release) when unset in the environment to provide sensible abort-by-default behavior.
custom_target
as test executableThe [[test]] function now accepts [[@custom_tgt]] and [[@custom_idx]] for the command to execute.