title: Release 0.53.0 short-description: Release notes for 0.53.0 ...
The new fs
module can be used to examine the contents of the current file system.
fs = import('fs') assert(fs.exists('important_file'), 'The important file is missing.')
meson dist
command line now gained --include-subprojects
command line option. When enabled, the source tree of all subprojects used by the current build will also be included in the final tarball. This is useful to distribute self contained tarball that can be built offline (i.e. --wrap-mode=nodownload
).
Dlang
, Rust
, Objective-C
Meson now ships with predefined project templates for Dlang
, Fortran
, Rust
, Objective-C
, and by passing the associated flags d
, fortran
, rust
, objc
to meson init --language
.
A new function [[summary]] has been added to summarize build configuration at the end of the build process.
Example:
project('My Project', version : '1.0') summary({'bindir': get_option('bindir'), 'libdir': get_option('libdir'), 'datadir': get_option('datadir'), }, section: 'Directories') summary({'Some boolean': false, 'Another boolean': true, 'Some string': 'Hello World', 'A list': ['string', 1, true], }, section: 'Configuration')
Output:
My Project 1.0 Directories prefix: /opt/gnome bindir: bin libdir: lib/x86_64-linux-gnu datadir: share Configuration Some boolean: False Another boolean: True Some string: Hello World A list: string 1 True
Previous to Meson 0.52.0 you set the dynamic linker using compiler specific flags passed via language flags and hoped things worked out. In version 0.52.0 Meson started detecting the linker and making intelligent decisions about using it. Unfortunately this broke choosing a non-default linker.
Now there is a generic mechanism for doing this. In 0.53.0, you can use the LD
environment variable. In 0.53.1 this was changed to <compiler_variable>_LD
, such as CC_LD
, CXX_LD
, D_LD
, etc due to regressions. The usual Meson environment variable rules apply. Alternatively, you can add the following to a cross or native file:
In 0.53.0:
[binaries] ld = 'gold'
In 0.53.1 or newer:
[binaries] c = 'gcc' c_ld = 'gold'
[binaries] c = 'clang' c_ld = 'lld'
And Meson will select the linker if possible.
fortran_std
optionnew in 0.53.0 Akin to the c_std
and cpp_std
options, the fortran_std
option sets Fortran compilers to warn or error on non-Fortran standard code. Only the Gfortran and Intel Fortran compilers have support for this option. Other Fortran compilers ignore the fortran_std
option.
Supported values for fortran_std
include:
legacy
for non-conforming code--this is especially important for Gfortran, which by default errors on old non-compliant Fortran codef95
for Fortran 95 compliant code.f2003
for Fortran 2003 compliant code.f2008
for Fortran 2008 compliant code.f2018
for Fortran 2018 compliant code.Added the embed
kwarg to the python module dependency function to select the python library that can be used to embed python into an application.
added in 0.53.0:
scalapack = dependency('scalapack')
Historically and through today, typical Scalapack setups have broken and incomplete pkg-config or FindScalapack.cmake. Meson handles finding Scalapack on setups including:
find_program()
It is now possible to give a list of absolute paths where find_program()
should also search, using the dirs
keyword argument.
For example on Linux /sbin
and /usr/sbin
are not always in the $PATH
:
prog = find_program('mytool', dirs : ['/usr/sbin', '/sbin'])
When the respective tools are available, ‘ctags’, ‘TAGS’ and ‘cscope’ targets will be generated by Meson, unless you have defined your own.
Keys can now be any expression evaluating to a string value, not limited to string literals any more.
d = {'a' + 'b' : 42} k = 'cd' d += {k : 43}
With this release even more CMake projects are supported via CMake subprojects due to these internal improvements:
add_dependency
add_custom_target
add_custom_command
supportsince 0.53.0, compiler.get_linker_id()
allows retrieving a lowercase name for the linker. Since each compiler family can typically use a variety of linkers depending on operating system, this helps users define logic for corner cases not otherwise easily handled.
Native support for compiling and linking against the CUDA Toolkit using the dependency
function:
project('CUDA test', 'cpp', meson_version: '>= 0.53.0') exe = executable('prog', 'prog.cc', dependencies: dependency('cuda'))
See the CUDA dependency for more information.
The new boolean option is called cpp_rtti
.
dependencies (--dependencies, intro-dependencies.json):
version
keyscanning dependencies (--scan-dependencies):
version
key containing the required dependency versiontests and benchmarks (--tests, --benchmarks, intro-tests.json, intro-benchmarks.json):
protocol
key