Debian Codegraph @

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

raw
1 ---
2 title: Release 1.4.0
3 short-description: Release notes for 1.4.0
4 ...
5
6 # New features
7
8 Meson 1.4.0 was released on 12 March 2024
9
10 ## Added support for `[[@build_tgt]]`, `[[@custom_tgt]]`, and `[[@custom_idx]]` to certain FS module functions
11
12 Support for `[[@build_tgt]]`, `[[@custom_tgt]]`, and `[[@custom_idx]]` was
13 added to the following FS module APIs:
14
15 - `fs.name`
16 - `fs.parent`
17 - `fs.replace_suffix`
18 - `fs.stem`
19
20 ## Meson now reads the project version of cmake subprojects
21
22 CMake subprojects configured by meson will now have their project
23 version set to the project version in their CMakeLists.txt. This
24 allows version constraints to be properly checked when falling back to
25 a cmake subproject.
26
27 ## `ndebug` setting now controls C++ stdlib assertions
28
29 The `ndebug` setting, if disabled, now passes preprocessor defines to enable
30 debugging assertions within the C++ standard library.
31
32 For GCC, `-D_GLIBCXX_ASSERTIONS=1` is set.
33
34 For Clang, `-D_GLIBCXX_ASSERTIONS=1` is set to cover libstdc++ usage,
35 and `-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE` or
36 `-D_LIBCPP_ENABLE_ASSERTIONS=1` is used depending on the Clang version.
37
38 ## `stldebug` gains Clang support
39
40 For Clang, we now pass `-D_GLIBCXX_DEBUG=1` if `debugstl` is enabled, and
41 we also pass `-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG`.
42
43 ## New `unset()` method on `environment` objects
44
45 [[@env]] now has an [[env.unset]] method to ensure an existing environment
46 is *not* defined.
47
48 ## File object now has `full_path()` method
49
50 Returns a full path pointing to the file. This is useful for printing the path
51 with e.g [[message]] function for debugging purpose.
52
53 **NOTE:** In most cases using the object itself will do the same job
54 as this and will also allow Meson to setup dependencies correctly.
55
56 ## New numpy custom dependency
57
58 Support for `dependency('numpy')` was added, via supporting the `numpy-config` tool and
59 pkg-config support, both of which are available since NumPy 2.0.0.
60
61 Config-tool support is useful because it will work out of the box when
62 ``numpy`` is installed, while the pkg-config file is located inside python's
63 site-packages, which makes it impossible to use in an out of the box manner
64 without setting `PKG_CONFIG_PATH`.
65
66 ## `depends` kwarg now supported by compiler.preprocess()
67
68 It is now possible to specify the dependent targets with `depends:`
69 for compiler.preprocess(). These targets should be built before the
70 preprocessing starts.
71
72 ## Added `preserve_paths` keyword argument to qt module functions.
73
74 In `qt4`, `qt5`, and `qt6` modules, `compile_ui`, `compile_moc`, and
75 `preprocess` functions now have a `preserve_paths` keyword argument.
76
77 If `'true`, it specifies that the output files need to maintain their directory
78 structure inside the target temporary directory. For instance, when a file
79 called `subdir/one.input` is processed it generates a file
80 `{target private directory}/subdir/one.out` when `true`,
81 and `{target private directory}/one.out` when `false` (default).
82
83 ## Bindgen will now use Meson's heuristic for what is a C++ header
84
85 Bindgen natively assumes that a file with the extension `.hpp` is a C++ header,
86 but that everything else is a C header. Meson has a whole list of extensions it
87 considers to be C++, and now will automatically look for those extensions and
88 set bindgen to treat those as C++
89
90 ## Overriding bindgen language setting
91
92 Even though Meson will now tell bindgen to do the right thing in most cases,
93 there may still be cases where Meson does not have the intended behavior,
94 specifically with headers with a `.h` suffix, but are C++ headers.
95
96 ## Bindgen now uses the same C/C++ std as the project as a whole
97
98 Which is very important for C++ bindings.
99
100 ## Tests now abort on errors by default under more sanitizers
101
102 Sanitizers like MemorySanitizer do not abort
103 by default on detected violations. Meson now exports `MSAN_OPTIONS` (in addition to
104 `ASAN_OPTIONS` and `UBSAN_OPTIONS` from a previous release) when unset in the
105 environment to provide sensible abort-by-default behavior.
106
107 ## Use `custom_target` as test executable
108
109 The [[test]] function now accepts [[@custom_tgt]] and [[@custom_idx]] for the
110 command to execute.
111