Debian Codegraph @

subprojects/meson-docs/docs/markdown/Release-notes-for-0.53.0.md

raw
1 ---
2 title: Release 0.53.0
3 short-description: Release notes for 0.53.0
4 ...
5
6 # New features
7
8 ## A new module for filesystem operations
9
10 The new `fs` module can be used to examine the contents of the current
11 file system.
12
13 ```meson
14 fs = import('fs')
15 assert(fs.exists('important_file'),
16 'The important file is missing.')
17 ```
18
19 ## meson dist --include-subprojects
20
21 `meson dist` command line now gained `--include-subprojects` command
22 line option. When enabled, the source tree of all subprojects used by
23 the current build will also be included in the final tarball. This is
24 useful to distribute self contained tarball that can be built offline
25 (i.e. `--wrap-mode=nodownload`).
26
27 ## Added new Meson templates for `Dlang`, `Rust`, `Objective-C`
28
29 Meson now ships with predefined project templates for `Dlang`,
30 `Fortran`, `Rust`, `Objective-C`, and by passing the associated flags `d`,
31 `fortran`, `rust`, `objc` to `meson init --language`.
32
33 ## Add a new summary() function
34
35 A new function [[summary]] has been
36 added to summarize build configuration at the end of the build
37 process.
38
39 Example:
40 ```meson
41 project('My Project', version : '1.0')
42 summary({'bindir': get_option('bindir'),
43 'libdir': get_option('libdir'),
44 'datadir': get_option('datadir'),
45 }, section: 'Directories')
46 summary({'Some boolean': false,
47 'Another boolean': true,
48 'Some string': 'Hello World',
49 'A list': ['string', 1, true],
50 }, section: 'Configuration')
51 ```
52
53 Output:
54 ```
55 My Project 1.0
56
57 Directories
58 prefix: /opt/gnome
59 bindir: bin
60 libdir: lib/x86_64-linux-gnu
61 datadir: share
62
63 Configuration
64 Some boolean: False
65 Another boolean: True
66 Some string: Hello World
67 A list: string
68 1
69 True
70 ```
71
72 ## Generic Overrider for Dynamic Linker selection
73
74 Previous to Meson 0.52.0 you set the dynamic linker using compiler
75 specific flags passed via language flags and hoped things worked out.
76 In version 0.52.0 Meson started detecting the linker and making
77 intelligent decisions about using it. Unfortunately this broke
78 choosing a non-default linker.
79
80 Now there is a generic mechanism for doing this. In 0.53.0, you can
81 use the `LD` environment variable. **In 0.53.1** this was changed to
82 `<compiler_variable>_LD`, such as `CC_LD`, `CXX_LD`, `D_LD`, etc due
83 to regressions. The usual Meson [environment variable
84 rules](https://mesonbuild.com/Running-Meson.html#environment-variables)
85 apply. Alternatively, you can add the following to a cross or native
86 file:
87
88 In 0.53.0:
89
90 ```ini
91 [binaries]
92 ld = 'gold'
93 ```
94
95 **In 0.53.1 or newer**:
96
97 ```ini
98 [binaries]
99 c = 'gcc'
100 c_ld = 'gold'
101 ```
102
103 ```ini
104 [binaries]
105 c = 'clang'
106 c_ld = 'lld'
107 ```
108
109 And Meson will select the linker if possible.
110
111 ## `fortran_std` option
112
113 **new in 0.53.0** Akin to the `c_std` and `cpp_std` options, the
114 `fortran_std` option sets Fortran compilers to warn or error on
115 non-Fortran standard code. Only the Gfortran and Intel Fortran
116 compilers have support for this option. Other Fortran compilers ignore
117 the `fortran_std` option.
118
119 Supported values for `fortran_std` include:
120
121 * `legacy` for non-conforming code--this is especially important for Gfortran, which by default errors on old non-compliant Fortran code
122 * `f95` for Fortran 95 compliant code.
123 * `f2003` for Fortran 2003 compliant code.
124 * `f2008` for Fortran 2008 compliant code.
125 * `f2018` for Fortran 2018 compliant code.
126
127 ## python.dependency() embed kwarg
128
129 Added the `embed` kwarg to the python module dependency function to
130 select the python library that can be used to embed python into an
131 application.
132
133 ## Scalapack
134
135 added in **0.53.0**:
136
137 ```meson
138 scalapack = dependency('scalapack')
139 ```
140
141 Historically and through today, typical Scalapack setups have broken
142 and incomplete pkg-config or FindScalapack.cmake. Meson handles
143 finding Scalapack on setups including:
144
145 * Linux: Intel MKL or OpenMPI + Netlib
146 * MacOS: Intel MKL or OpenMPI + Netlib
147 * Windows: Intel MKL (OpenMPI not available on Windows)
148
149 ## Search directories for `find_program()`
150
151 It is now possible to give a list of absolute paths where `find_program()` should
152 also search, using the `dirs` keyword argument.
153
154 For example on Linux `/sbin` and `/usr/sbin` are not always in the `$PATH`:
155 ```meson
156 prog = find_program('mytool', dirs : ['/usr/sbin', '/sbin'])
157 ```
158
159 ## Source tags targets
160
161 When the respective tools are available, 'ctags', 'TAGS' and 'cscope'
162 targets will be generated by Meson, unless you have defined your own.
163
164 ## Dictionary entry using string variable as key
165
166 Keys can now be any expression evaluating to a string value, not limited
167 to string literals any more.
168 ```meson
169 d = {'a' + 'b' : 42}
170 k = 'cd'
171 d += {k : 43}
172 ```
173
174 ## Improved CMake subprojects support
175
176 With this release even more CMake projects are supported via [CMake
177 subprojects](CMake-module.md#cmake-subprojects) due to these internal
178 improvements:
179
180 - Use the CMake file API for CMake >=3.14
181 - Handle the explicit dependencies via `add_dependency`
182 - Basic support for `add_custom_target`
183 - Improved `add_custom_command` support
184 - Object library support on Windows
185
186 ## compiler.get_linker_id()
187
188 since 0.53.0, `compiler.get_linker_id()` allows retrieving a lowercase
189 name for the linker. Since each compiler family can typically use a
190 variety of linkers depending on operating system, this helps users
191 define logic for corner cases not otherwise easily handled.
192
193 ## CUDA dependency
194
195 Native support for compiling and linking against the CUDA Toolkit
196 using the `dependency` function:
197
198 ```meson
199 project('CUDA test', 'cpp', meson_version: '>= 0.53.0')
200 exe = executable('prog', 'prog.cc', dependencies: dependency('cuda'))
201 ```
202
203 See [the CUDA dependency](Dependencies.md#cuda) for more information.
204
205 ## Added global option to disable C++ RTTI
206
207 The new boolean option is called `cpp_rtti`.
208
209 ## Introspection API changes
210
211 dependencies (--dependencies, intro-dependencies.json):
212 - added the `version` key
213
214 scanning dependencies (--scan-dependencies):
215 - added the `version` key containing the required dependency version
216
217 tests and benchmarks (--tests, --benchmarks, intro-tests.json,
218 intro-benchmarks.json):
219 - added the `protocol` key