Debian Codegraph @

subprojects/meson-docs/docs/yaml/functions/declare_dependency.yaml

raw
1 name: declare_dependency
2 returns: dep
3 description: |
4 This function returns a [[@dep]] object that
5 behaves like the return value of [[dependency]] but is
6 internal to the current build. One use case for this is in
7 subprojects. This allows a subproject to easily specify how it should
8 be used. This makes it interchangeable with the same dependency that
9 is provided externally by the system. Another common use case is to
10 declare project targets as dependencies so they may be used as
11 dependencies of other build targets.
12
13 kwargs:
14 compile_args:
15 type: list[str]
16 description: Compile arguments to use.
17
18 dependencies:
19 type: list[dep]
20 description: Other dependencies needed to use this dependency.
21
22 include_directories:
23 type: list[inc | str]
24 description: |
25 the directories to add to header search path,
26 must be [[@inc]] objects or *(since 0.50.0)* plain strings.
27
28 link_args:
29 type: list[str]
30 description: Link arguments to use.
31
32 link_with:
33 type: list[lib]
34 description: Libraries to link against.
35
36 link_whole:
37 type: list[lib]
38 since: 0.46.0
39 description: Libraries to link fully, same as [[executable]].
40
41 sources:
42 type: list[str | file | custom_tgt | custom_idx | generated_list]
43 description: |
44 sources to add to targets
45 (or generated header files
46 that should be built before sources including them are built)
47
48 extra_files:
49 type: list[str | file]
50 since: 1.2.0
51 description: |
52 extra files to add to targets.
53 mostly used for IDE integration.
54
55 version:
56 type: str
57 description: |
58 the version of this dependency,
59 such as `1.2.3`. Defaults to the project version.
60
61 variables:
62 type: dict[str] | list[str]
63 since: 0.54.0
64 description: |
65 a dictionary of arbitrary strings,
66 this is meant to be used
67 in subprojects where special variables would be provided via cmake or
68 pkg-config. *since 0.56.0* it can also be a list of `'key=value'` strings.
69
70 d_module_versions:
71 type: str | int | list[str | int]
72 since: 0.62.0
73 description: |
74 The [D version identifiers](https://dlang.org/spec/version.html#version) to add
75 during the compilation of D source files.
76
77 d_import_dirs:
78 type: list[inc | str]
79 since: 0.62.0
80 description: |
81 the directories to add to the string search path (i.e. `-J` switch for DMD).
82 Must be [[@inc]] objects or plain strings.
83
84 objects:
85 type: list[extracted_obj]
86 since: 1.1.0
87 description: |
88 a list of object files, to be linked directly into the targets that use the
89 dependency.