Debian Codegraph @

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

raw
1 ---
2 title: Release 0.37
3 short-description: Release notes for 0.37
4 ...
5
6 # New features
7
8 ## Mesontest
9
10 Mesontest is a new testing tool that allows you to run your tests in
11 many different ways. As an example you can run tests multiple times:
12
13 mesontest --repeat=1000 a_test
14
15 or with an arbitrary wrapper executable:
16
17 mesontest --wrap='valgrind --tool=helgrind' a_test
18
19 or under `gdb`, 1000 times in a row. This is handy for tests that fail
20 spuriously, as when the crash happens you are given the full GDB
21 command line:
22
23 mesontest --repeat=1000 --gdb a_test
24
25 ## Mesonrewriter
26
27 Mesonrewriter is an experimental tool to manipulate your build
28 definitions programmatically. It is not installed by default yet but
29 those interested can run it from the source repository.
30
31 As an example, here is how you would add a source file to a build target:
32
33 mesonrewriter add --target=program --filename=new_source.c
34
35 ## Shared modules
36
37 The new `shared_module` function allows the creation of shared
38 modules, that is, extension modules such as plugins that are meant to
39 be used solely with `dlopen` rather than linking them to targets.
40
41 ## Gnome module
42
43 - Detect required programs and print useful errors if missing
44
45 ### gtkdoc
46
47 - Allow passing a list of directories to `src_dir` keyword argument
48 - Add `namespace` keyword argument
49 - Add `mode` keyword argument
50 - Fix `gtkdoc-scangobj` finding local libraries
51
52 ### compile_resources
53
54 - Add `gresource_bundle` keyword argument to output `.gresource` files
55 - Add `export` and `install_header` keyword arguments
56 - Use depfile support available in GLib >= 2.52.0
57
58 ## i18n module
59
60 - Add `merge_file()` function for creating translated files
61 - Add `preset` keyword argument to included common gettext flags
62 - Read languages from `LINGUAS` file
63
64 ## LLVM IR compilation
65
66 Meson has long had support for compiling assembler (GAS) files. In
67 this release we add support for compiling LLVM IR files in a similar
68 way when building with the Clang compiler. Just add it to the list of
69 files when creating a `library` or `executable` target like any other
70 source file. No special handling is required:
71
72 ```meson
73 executable('some-exe', 'main.c', 'asm-file.S', 'ir-file.ll')
74 ```
75
76 As always, you can also mix LLVM IR files with C++, C, and Assembly
77 (GAS) sources.
78
79 ## ViM indent and syntax files
80
81 We now include filetype, indent, and syntax files for ViM [with the
82 source
83 tree](https://github.com/mesonbuild/meson/tree/master/data/syntax-highlighting/vim).
84 Please file issues (or pull requests!) for enhancements or if you face
85 any problems using them.
86
87 ## Push URLs in .wrap files
88
89 [.wrap files](Using-the-WrapDB.md) for subprojects can now include a
90 separate push URL to allow developers to push changes directly from a
91 subproject git checkout.
92
93 ## pkg-config dependencies
94
95 Meson now supports multiple version restrictions while searching for pkg-config dependencies.
96
97 ```meson
98 # Just want a lower limit
99 dependency('zlib', version : '>1.2.1')
100 # Want both a lower and an upper limit
101 dependency('opencv', version : ['>=2.3.0', '<=3.1.0'])
102 # Want to exclude one specific broken version
103 dependency('foolite', version : ['>=3.12.1', '!=3.13.99'])
104 ```
105
106 ## Overriding more binaries with environment variables
107
108 You can now specify the binary to be used for the following tools by
109 setting the corresponding environment variable
110
111 | Name | Environment variable |
112 | ---- | -------------------- |
113 | pkg-config | PKG_CONFIG |
114 | readelf | READELF |
115 | nm | NM |
116
117 ## Support for `localstatedir`
118
119 Similar to other options such as `bindir` and `datadir`, you can now
120 specify the `localstatedir` for a project by passing
121 `--localstatedir=dir` to `meson` or `-Dlocalstatedir=dir` to
122 `mesonconf` after configuration. You can also access it from inside
123 the `meson.build` file with `get_option('localstatedir')`.
124
125 ## New compiler function `symbols_have_underscore_prefix`
126
127 Checks if the compiler prefixes an underscore to C global symbols with
128 the default calling convention. This is useful when linking to
129 compiled assembly code, or other code that does not have its C symbol
130 mangling handled transparently by the compiler.
131
132 ```meson
133 cc = meson.get_compiler('c')
134 conf = configuration_data()
135 if cc.symbols_have_underscore_prefix()
136 conf.set('SYMBOLS_HAVE_UNDERSCORE', true)
137 endif
138 ```
139
140 C symbol mangling is platform and architecture dependent, and a helper
141 function is needed to detect it. For example, Windows 32-bit prefixes
142 underscore, but 64-bit does not. Linux does not prefix an underscore
143 but OS X does.
144
145 ## Vala
146
147 GLib Resources compiled with
148 [`gnome.compile_resources`](Gnome-module.md#compile_resources) that
149 are added to the sources of a Vala build target will now cause the
150 appropriate `--gresources` flag to be passed to the Vala compiler so
151 you don't need to add that yourself to `vala_args:`.
152
153 ## Improvements to install scripts
154
155 You can now pass arguments to install scripts added with
156 [[meson.add_install_script]]. All
157 arguments after the script name will be passed to the script.
158
159 The `MESON_INSTALL_DESTDIR_PREFIX` environment variable is now set
160 when install scripts are called. This contains the values of the
161 `DESTDIR` environment variable and the `prefix` option passed to Meson
162 joined together. This is useful because both those are usually
163 absolute paths, and joining absolute paths in a cross-platform way is
164 tricky. [`os.path.join` in
165 Python](https://docs.python.org/3/library/os.path.html#os.path.join)
166 will discard all previous path segments when it encounters an absolute
167 path, and simply concatenating them will not work on Windows where
168 absolute paths begin with the drive letter.
169
170 ## More install directories
171
172 Added new options `sbindir` and `infodir` that can be used for
173 installation.