Debian Codegraph @

subprojects/meson-docs/docs/yaml/objects/build_tgt.yaml

raw
1 name: build_tgt
2 long_name: Build target
3 extends: tgt
4 description: |
5 A build target is either an executable, shared library, static library,
6 both shared and static library or shared module.
7
8 methods:
9 - name: extract_objects
10 returns: extracted_obj
11 description: |
12 Returns an opaque value representing the object files generated for those
13 source files. This is typically used to take single object files and link
14 them to unit tests or to compile some source files with custom flags. To
15 use the object file(s) in another build target, use the
16 `objects:` keyword argument to a [[build_target]] or [[declare_dependency]],
17 or include them in the command line of a [[custom_target]].
18 varargs:
19 name: source
20 type: str | file | custom_tgt | custom_idx | generated_list
21 description: |
22 Source filenames for which the built objects should be extracted.
23 min_varargs: 1
24
25 - name: extract_all_objects
26 returns: extracted_obj
27 description: |
28 Acts the same as `extract_objects`, but returns all object files generated
29 by this target.
30
31 By default only objects built for this target are returned to maintain
32 backward compatibility with previous versions. The default value for the
33 `recursive` kwarg will eventually be changed to `true` in a future version.
34 kwargs:
35 recursive:
36 type: bool
37 description: |
38 Also return objects passed to the `objects` argument of this target.
39 since: 0.46.0
40 default: true
41
42 - name: full_path
43 returns: str
44 description: |
45 Returns a full path pointing to the result target file.
46 **NOTE:** In most cases using the object itself will do the same job
47 as this and will also allow Meson to setup inter-target dependencies
48 correctly. Please file a bug if that doesn't work for you.
49
50 - name: path
51 returns: str
52 since: 0.59.0
53 deprecated: 0.59.0
54 description: |
55 Does the exact same as [[build_tgt.full_path]]. **NOTE**: This
56 function is solely kept for compatibility with [[@external_program]] objects.
57 It will be removed once the, also deprecated, corresponding `path()`
58 function in the [[@external_program]] object is removed.
59
60 - name: private_dir_include
61 returns: inc
62 description: |
63 Returns a value that works like [[include_directories]], but points to the
64 private directory of this target. Usually only needed if an another target
65 needs to access some generated internal headers of this target.
66
67 - name: name
68 returns: str
69 since: 0.54.0
70 description: Returns the name of the target.
71
72 - name: get_id
73 returns: str
74 since: 0.26.0
75 description: Returns a unique id for the target
76
77 - name: outdir
78 returns: str
79 since: 0.26.0
80 description: Returns the output directory relative to the build root of the
81 target
82
83 - name: found
84 returns: bool
85 since: 0.59.0
86 description: |
87 Always returns `true`. This function is meant to make executables
88 objects feature compatible with [[@external_program]] objects. This
89 simplifies use-cases where an executable is used instead of
90 an [[@external_program]].