summaryrefslogtreecommitdiff
path: root/docs/markdown/snippets/partial-dependencies.md
blob: 8d2136ace99f09c142d13452e602a1c550030854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Added new partial_dependency method to dependencies and libraries

It is now possible to use only part of a dependency in a target. This allows,
for example, to only use headers with convenience libraries to avoid linking
to the same library multiple times.

```meson

dep = dependency('xcb')

helper = static_library(
  'helper',
  ['helper1.c', 'helper2.c'],
  dependencies : dep.partial_dependency(includes : true),
]

final = shared_library(
  'final',
  ['final.c'],
  dependencyes : dep,
)
```

A partial dependency will have the same name version as the full dependency it
is derived from, as well as any values requested.