| 1 |
--- |
| 2 |
title: Release 0.43 |
| 3 |
short-description: Release notes for 0.43 |
| 4 |
... |
| 5 |
|
| 6 |
## Portability improvements to Boost Dependency |
| 7 |
|
| 8 |
The Boost dependency has been improved to better detect the various |
| 9 |
ways to install boost on multiple platforms. At the same time the |
| 10 |
`modules` semantics for the dependency has been changed. Previously it |
| 11 |
was allowed to specify header directories as `modules` but it wasn't |
| 12 |
required. Now, modules are only used to specify libraries that require |
| 13 |
linking. |
| 14 |
|
| 15 |
This is a breaking change and the fix is to remove all modules that aren't |
| 16 |
found. |
| 17 |
|
| 18 |
## Generator learned capture |
| 19 |
|
| 20 |
Generators can now be configured to capture the standard output. See |
| 21 |
`test cases/common/98 gen extra/meson.build` for an example. |
| 22 |
|
| 23 |
## Can index CustomTarget objects |
| 24 |
|
| 25 |
The `CustomTarget` object can now be indexed like an array. The |
| 26 |
resulting object can be used as a source file for other Targets, this |
| 27 |
will create a dependency on the original `CustomTarget`, but will only |
| 28 |
insert the generated file corresponding to the index value of the |
| 29 |
`CustomTarget`'s `output` keyword. |
| 30 |
|
| 31 |
```meson |
| 32 |
c = custom_target( |
| 33 |
... |
| 34 |
output : ['out.h', 'out.c'], |
| 35 |
) |
| 36 |
lib1 = static_library( |
| 37 |
'lib1', |
| 38 |
[lib1_sources, c[0]], |
| 39 |
... |
| 40 |
) |
| 41 |
exec = executable( |
| 42 |
'executable', |
| 43 |
c[1], |
| 44 |
link_with : lib1, |
| 45 |
) |
| 46 |
``` |
| 47 |
|
| 48 |
## Can override executables in the cross file |
| 49 |
|
| 50 |
The cross file can now be used for overriding the result of |
| 51 |
`find_program`. As an example if you want to find the `objdump` |
| 52 |
command and have the following definition in your cross file: |
| 53 |
|
| 54 |
```ini |
| 55 |
[binaries] |
| 56 |
... |
| 57 |
objdump = '/usr/bin/arm-linux-gnueabihf-objdump-6' |
| 58 |
``` |
| 59 |
|
| 60 |
Then issuing the command `find_program('objdump')` will return the |
| 61 |
version specified in the cross file. If you need the build machine's |
| 62 |
objdump, you can specify the `native` keyword like this: |
| 63 |
|
| 64 |
```meson |
| 65 |
native_objdump = find_program('objdump', native : true) |
| 66 |
``` |
| 67 |
|
| 68 |
## Easier handling of supported compiler arguments |
| 69 |
|
| 70 |
A common pattern for handling multiple desired compiler arguments, was |
| 71 |
to test their presence and add them to an array one-by-one, e.g.: |
| 72 |
|
| 73 |
```meson |
| 74 |
warning_flags_maybe = [ |
| 75 |
'-Wsomething', |
| 76 |
'-Wanother-thing', |
| 77 |
'-Wno-the-other-thing', |
| 78 |
] |
| 79 |
warning_flags = [] |
| 80 |
foreach flag : warning_flags_maybe |
| 81 |
if cc.has_argument(flag) |
| 82 |
warning_flags += flag |
| 83 |
endif |
| 84 |
endforeach |
| 85 |
cc.add_project_argument(warning_flags) |
| 86 |
``` |
| 87 |
|
| 88 |
A helper has been added for the foreach/has_argument pattern, so you |
| 89 |
can now simply do: |
| 90 |
|
| 91 |
```meson |
| 92 |
warning_flags = [ ... ] |
| 93 |
flags = cc.get_supported_arguments(warning_flags) |
| 94 |
``` |
| 95 |
|
| 96 |
## Better support for shared libraries in non-system paths |
| 97 |
|
| 98 |
Meson has support for prebuilt object files and static libraries. This |
| 99 |
release adds feature parity to shared libraries that are either in |
| 100 |
non-standard system paths or shipped as part of your project. On |
| 101 |
systems that support rpath, Meson automatically adds rpath entries to |
| 102 |
built targets using manually found external libraries. |
| 103 |
|
| 104 |
This means that e.g. supporting prebuilt libraries shipped with your |
| 105 |
source or provided by subprojects or wrap definitions by writing a |
| 106 |
build file like this: |
| 107 |
|
| 108 |
```meson |
| 109 |
project('myprebuiltlibrary', 'c') |
| 110 |
|
| 111 |
cc = meson.get_compiler('c') |
| 112 |
prebuilt = cc.find_library('mylib', dirs : meson.current_source_dir()) |
| 113 |
mydep = declare_dependency(include_directories : include_directories('.'), |
| 114 |
dependencies : prebuilt) |
| 115 |
``` |
| 116 |
|
| 117 |
Then you can use the dependency object in the same way as any other. |
| 118 |
|
| 119 |
## wrap-svn |
| 120 |
|
| 121 |
The [Wrap dependency system](Wrap-dependency-system-manual.md) now |
| 122 |
supports [Subversion](https://subversion.apache.org/) (svn). This |
| 123 |
support is rudimentary. The repository url has to point to a specific |
| 124 |
(sub)directory containing the `meson.build` file (typically `trunk/`). |
| 125 |
However, providing a `revision` is supported. |