-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathReference-manual_builtin_meson.html
1690 lines (1647 loc) · 91.6 KB
/
Reference-manual_builtin_meson.html
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<base href=".">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>meson</title>
<link rel="stylesheet" href="assets/css/dark-frontend.css" type="text/css" title="dark">
<link rel="alternate stylesheet" href="assets/css/light-frontend.css" type="text/css" title="light">
<link rel="stylesheet" href="assets/css/bootstrap-toc.min.css" type="text/css">
<link rel="stylesheet" href="assets/css/jquery.mCustomScrollbar.min.css">
<link rel="stylesheet" href="assets/js/search/enable_search.css" type="text/css">
<link rel="stylesheet" href="assets/css/prism-tomorrow.css" type="text/css" title="dark">
<link rel="alternate stylesheet" href="assets/css/prism.css" type="text/css" title="light">
<script src="assets/js/mustache.min.js"></script>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.js"></script>
<script src="assets/js/scrollspy.js"></script>
<script src="assets/js/typeahead.jquery.min.js"></script>
<script src="assets/js/search.js"></script>
<script src="assets/js/compare-versions.js"></script>
<script src="assets/js/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="assets/js/bootstrap-toc.min.js"></script>
<script src="assets/js/jquery.touchSwipe.min.js"></script>
<script src="assets/js/anchor.min.js"></script>
<script src="assets/js/tag_filtering.js"></script>
<script src="assets/js/language_switching.js"></script>
<script src="assets/js/styleswitcher.js"></script>
<script src="assets/js/lines_around_headings.js"></script>
<script src="assets/js/prism-core.js"></script>
<script src="assets/js/prism-autoloader.js"></script>
<script src="assets/js/prism_autoloader_path_override.js"></script>
<script src="assets/js/prism-keep-markup.js"></script>
<script src="assets/js/trie.js"></script>
<link rel="icon" type="image/png" href="assets/images/favicon.png">
<link rel="shortcut icon" href="assets/images/favicon.png">
</head>
<body class="no-script
">
<script>
$('body').removeClass('no-script');
</script>
<nav class="navbar navbar-fixed-top navbar-default" id="topnav">
<div class="container-fluid">
<div class="navbar-right">
<a id="toc-toggle">
<span class="glyphicon glyphicon-menu-right"></span>
<span class="glyphicon glyphicon-menu-left"></span>
</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-wrapper" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span title="light mode switch" class="glyphicon glyphicon-sunglasses pull-right" id="lightmode-icon"></span>
<form class="navbar-form pull-right" id="navbar-search-form">
<div class="form-group has-feedback">
<input type="text" class="form-control input-sm" name="search" id="sidenav-lookup-field" placeholder="search" disabled>
<span class="glyphicon glyphicon-search form-control-feedback" id="search-mgn-glass"></span>
</div>
</form>
</div>
<div class="navbar-header">
<a id="sidenav-toggle">
<span class="glyphicon glyphicon-menu-right"></span>
<span class="glyphicon glyphicon-menu-left"></span>
</a>
<a id="home-link" href="index.html" class="hotdoc-navbar-brand">
<img src="assets/images/meson_logo.png" alt="Home">
</a>
</div>
<div class="navbar-collapse collapse" id="navbar-wrapper">
<ul class="nav navbar-nav" id="menu">
<li class="dropdown">
<a class="dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Modules <span class="caret"></span>
</a>
<ul class="dropdown-menu" id="modules-menu">
<li>
<a href="CMake-module.html">CMake</a>
</li>
<li>
<a href="Cuda-module.html">CUDA</a>
</li>
<li>
<a href="Dlang-module.html">Dlang</a>
</li>
<li>
<a href="External-Project-module.html">External Project</a>
</li>
<li>
<a href="Fs-module.html">Filesystem</a>
</li>
<li>
<a href="Gnome-module.html">GNOME</a>
</li>
<li>
<a href="Hotdoc-module.html">Hotdoc</a>
</li>
<li>
<a href="i18n-module.html">i18n</a>
</li>
<li>
<a href="Icestorm-module.html">Icestorm</a>
</li>
<li>
<a href="Java-module.html">Java</a>
</li>
<li>
<a href="Keyval-module.html">Keyval</a>
</li>
<li>
<a href="Pkgconfig-module.html">Pkgconfig</a>
</li>
<li>
<a href="Python-3-module.html">Python 3</a>
</li>
<li>
<a href="Python-module.html">Python</a>
</li>
<li>
<a href="Qt4-module.html">Qt4</a>
</li>
<li>
<a href="Qt5-module.html">Qt5</a>
</li>
<li>
<a href="Qt6-module.html">Qt6</a>
</li>
<li>
<a href="Rust-module.html">Rust</a>
</li>
<li>
<a href="Simd-module.html">Simd</a>
</li>
<li>
<a href="SourceSet-module.html">SourceSet</a>
</li>
<li>
<a href="Wayland-module.html">Wayland</a>
</li>
<li>
<a href="Windows-module.html">Windows</a>
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Quick References <span class="caret"></span>
</a>
<ul class="dropdown-menu" id="quick-refs-menu">
<li>
<a href="Reference-manual.html">Functions</a>
</li>
<li>
<a href="Build-options.html">Options</a>
</li>
<li>
<a href="Configuration.html">Configuration</a>
</li>
<li>
<a href="Dependencies.html">Dependencies</a>
</li>
<li>
<a href="Unit-tests.html">Tests</a>
</li>
<li>
<a href="Syntax.html">Syntax</a>
</li>
</ul>
</li>
</ul>
<div class="hidden-xs hidden-sm navbar-text navbar-center">
<p><b>The Meson Build System</b></p>
</div>
</div>
</div>
</nav>
<main>
<div data-extension="core" data-hotdoc-in-toplevel="True" data-hotdoc-project="Meson-documentation" data-hotdoc-ref="Reference-manual_builtin_meson.html" class="page_container" id="page-wrapper">
<script src="assets/js/utils.js"></script>
<div class="panel panel-collapse oc-collapsed" id="sidenav" data-hotdoc-role="navigation">
<script src="assets/js/full-width.js"></script>
<div id="sitenav-wrapper">
<iframe src="hotdoc-sitemap.html" id="sitenav-frame"></iframe>
</div>
</div>
<div id="body">
<div id="main">
<div id="page-description" data-hotdoc-role="main">
<h1 id="meson-object-meson">Meson object (<code>meson</code>)</h1>
<p>The <code>meson</code> object allows you to introspect various properties of the
system. This object is always mapped in the <code>meson</code> variable.</p>
<h2 id="meson-object-methods">Meson object methods</h2>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesonadd_devenv">meson.add_devenv()</h3>
<p>add an <a href="Reference-manual_returned_env.html"><ins><code>env</code></ins></a> object (returned by <a href="Reference-manual_functions.html#environment"><ins><code>environment()</code></ins></a>)
to the list of environments that will be applied when using <a href="Commands.html#devenv"><code>meson devenv</code></a>
command line.</p>
<p>This is useful for developers who wish to use the project without
installing it, it is often needed to set for example the path to plugins
directory, etc. Alternatively, a list or dictionary can be passed as first
argument.</p>
<pre><code class="language-meson">devenv = environment()
devenv.set('PLUGINS_PATH', meson.current_build_dir())
...
meson.add_devenv(devenv)
</code></pre>
<p>After configuring and compiling that project, a terminal can be opened with
the environment set:</p>
<pre><code class="language-sh">$ meson devenv -C <builddir>
$ echo $PLUGINS_PATH
/path/to/source/subdir
</code></pre>
<p>See <a href="Commands.html#devenv"><code>meson devenv</code></a> command documentation for a list of
environment variables that are set by default by Meson.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.58.0)</em></p>
</div>
</div>
</div>
<pre><code class="language-meson"># add an <a href="Reference-manual_returned_env.html"><ins><code>env</code></ins></a> object (returned by <a href="Reference-manual_functions.html#environment"><ins><code>environment()</code></ins></a>)
<a href="Reference-manual_elementary_void.html"><ins>void</ins></a> add_devenv(
<a href="Reference-manual_returned_env.html"><ins>env</ins></a> | <a href="Reference-manual_elementary_str.html"><ins>str</ins></a> | <a href="Reference-manual_elementary_list.html"><ins>list</ins></a>[<a href="Reference-manual_elementary_str.html"><ins>str</ins></a>] | <a href="Reference-manual_elementary_dict.html"><ins>dict</ins></a>[<a href="Reference-manual_elementary_str.html"><ins>str</ins></a>] | <a href="Reference-manual_elementary_dict.html"><ins>dict</ins></a>[<a href="Reference-manual_elementary_list.html"><ins>list</ins></a>[<a href="Reference-manual_elementary_str.html"><ins>str</ins></a>]] <a href="Reference-manual_builtin_meson.html#add_devenv_env"><b>env</b></a>, # The <a href="Reference-manual_returned_env.html"><ins><code>env</code></ins></a> object to add.
# Keyword arguments:
<a href="Reference-manual_builtin_meson.html#add_devenv_method"><b>method</b></a> : <a href="Reference-manual_elementary_str.html"><ins>str</ins></a> # Must be one of 'set', 'prepend', or 'append'
<a href="Reference-manual_builtin_meson.html#add_devenv_separator"><b>separator</b></a> : <a href="Reference-manual_elementary_str.html"><ins>str</ins></a> # The separator to use for the initial values defined in
)</code></pre>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit more space -->
<h4 id="arguments">Arguments</h4>
<p>The method <code>meson.add_devenv()</code> accepts the following positional arguments:</p>
<!-- Hotdoc / markdown inserts <p> around the table elements. Override the margin to make them invisible -->
<style>
.nomargin p:last-child { margin-bottom: 0px !important; }
</style>
<table>
<thead>
<tr>
<th style="white-space: nowrap; text-align: center;">Name</th>
<th style="white-space: nowrap; text-align: center;">Type</th>
<th style="width: 56%;">Description</th>
<th style="white-space: nowrap; text-align: center; width: 0px;">Tags</th>
</tr>
</thead>
<tbody class="nomargin">
<tr id="add_devenv_env">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">env</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;">
<a href="Reference-manual_returned_env.html"><ins><code>env</code></ins></a> | <a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a> | <a href="Reference-manual_elementary_list.html"><ins><code>list</code></ins></a>[<a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a>] | <a href="Reference-manual_elementary_dict.html"><ins><code>dict</code></ins></a>[<a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a>] | <a href="Reference-manual_elementary_dict.html"><ins><code>dict</code></ins></a>[<a href="Reference-manual_elementary_list.html"><ins><code>list</code></ins></a>[<a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a>]]</td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>The <a href="Reference-manual_returned_env.html"><ins><code>env</code></ins></a> object to add.
Since <em>0.62.0</em> list of strings is allowed in dictionary values. In that
case values are joined using the separator.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
</div>
</td>
</tr>
</tbody>
</table>
<p style="padding: 5px; margin: 0px;"></p> <!-- Extra space -->
<p>Finally, <code>meson.add_devenv()</code>
accepts the following keyword arguments:</p>
<!-- Hotdoc / markdown inserts <p> around the table elements. Override the margin to make them invisible -->
<style>
.nomargin p:last-child { margin-bottom: 0px !important; }
</style>
<table>
<thead>
<tr>
<th style="white-space: nowrap; text-align: center;">Name</th>
<th style="white-space: nowrap; text-align: center;">Type</th>
<th style="width: 56%;">Description</th>
<th style="white-space: nowrap; text-align: center; width: 0px;">Tags</th>
</tr>
</thead>
<tbody class="nomargin">
<tr id="add_devenv_method">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">method</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;"><a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a></td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>Must be one of 'set', 'prepend', or 'append'
(defaults to 'set'). Controls if initial values defined in the first
positional argument are prepended, appended or replace the current value
of the environment variable.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.62.0)</em></p>
</div>
</td>
</tr>
<tr id="add_devenv_separator">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">separator</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;"><a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a></td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>The separator to use for the initial values defined in
the first positional argument. If not explicitly specified, the default
path separator for the host operating system will be used, i.e. ';' for
Windows and ':' for UNIX/POSIX systems.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.62.0)</em></p>
</div>
</td>
</tr>
</tbody>
</table>
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesonadd_dist_script">meson.add_dist_script()</h3>
<p>Causes the script given as argument to run during <code>dist</code>
operation after the
distribution source has been generated but before it is
archived. Note that this runs the script file that is in the
<em>staging</em> directory, not the one in the source directory. If the
script file cannot be found in the staging directory, it is a hard
error. The <code>MESON_DIST_ROOT</code> environment variables is set when dist scripts is
run.</p>
<p><em>(since 0.54.0)</em> The <code>MESON_SOURCE_ROOT</code> and <code>MESON_BUILD_ROOT</code>
environment variables are set when dist scripts are run. They are path to the
root source and build directory of the main project, even when the script
comes from a subproject.</p>
<p><em>(since 0.58.0)</em> This command can be invoked from a subproject, it was a hard
error in earlier versions. Subproject dist scripts will only be executed
when running <code>meson dist --include-subprojects</code>. <code>MESON_PROJECT_SOURCE_ROOT</code>,
<code>MESON_PROJECT_BUILD_ROOT</code> and <code>MESON_PROJECT_DIST_ROOT</code> environment
variables are set when dist scripts are run. They are identical to
<code>MESON_SOURCE_ROOT</code>, <code>MESON_BUILD_ROOT</code> and <code>MESON_DIST_ROOT</code> for main project
scripts, but for subproject scripts they have the path to the root of the
subproject appended, usually <code>subprojects/<subproject-name></code>.</p>
<p><em>(since 1.4.0)</em> The <code>MESONREWRITE</code> environment variable contains the path
to the rewrite command that corresponds to the <code>meson</code> executable that
was used to configure the build. (This might be a different path than the
first executable found in <code>PATH</code>.) It can be used to remove or replace
any <a href="Reference-manual_functions.html#run_command"><ins><code>run_command()</code></ins></a> that depends on the revision control system from the
build configuration. Note that the value will contain many parts. For
example, it may be <code>python3 /path/to/meson.py introspect</code>. The user is
responsible for splitting the string to an array if needed by splitting
lexically like a UNIX shell would. If your script uses Python,
<code>shlex.split()</code> is the easiest correct way to do this.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature1">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.48.0)</em></p>
</div>
</div>
</div>
<pre><code class="language-meson"># Causes the script given as argument to run during `dist`
<a href="Reference-manual_elementary_void.html"><ins>void</ins></a> add_dist_script(
<a href="Reference-manual_elementary_str.html"><ins>str</ins></a> | <a href="Reference-manual_returned_file.html"><ins>file</ins></a> | <a href="Reference-manual_returned_external_program.html"><ins>external_program</ins></a> <a href="Reference-manual_builtin_meson.html#add_dist_script_script_name"><b>script_name</b></a>, # The script to execute
<a href="Reference-manual_elementary_str.html"><ins>str</ins></a> | <a href="Reference-manual_returned_file.html"><ins>file</ins></a> | <a href="Reference-manual_returned_external_program.html"><ins>external_program</ins></a> <b>arg</b>..., # Additional arguments
)</code></pre>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit more space -->
<h4 id="arguments1">Arguments</h4>
<p>The method <code>meson.add_dist_script()</code> accepts the following positional arguments:</p>
<!-- Hotdoc / markdown inserts <p> around the table elements. Override the margin to make them invisible -->
<style>
.nomargin p:last-child { margin-bottom: 0px !important; }
</style>
<table>
<thead>
<tr>
<th style="white-space: nowrap; text-align: center;">Name</th>
<th style="white-space: nowrap; text-align: center;">Type</th>
<th style="width: 56%;">Description</th>
<th style="white-space: nowrap; text-align: center; width: 0px;">Tags</th>
</tr>
</thead>
<tbody class="nomargin">
<tr id="add_dist_script_script_name">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">script_name</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;">
<a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a> | <a href="Reference-manual_returned_file.html"><ins><code>file</code></ins></a> | <a href="Reference-manual_returned_external_program.html"><ins><code>external_program</code></ins></a>
</td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>The script to execute.</p>
<p><em>(since 0.55.0)</em> The output of <a href="Reference-manual_functions.html#find_program"><ins><code>find_program()</code></ins></a> as well as strings are accepted.</p>
<p><em>(since 0.57.0)</em> <a href="Reference-manual_returned_file.html"><ins><code>file</code></ins></a> objects and the output of <a href="Reference-manual_functions.html#configure_file"><ins><code>configure_file()</code></ins></a> may be used.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
</div>
</td>
</tr>
</tbody>
</table>
<p style="padding: 5px; margin: 0px;"></p> <!-- Extra space -->
<p>Additionally, the
method accepts between <code>0</code> and <code>infinity</code> variadic
arguments (<code>arg...</code>) of type <code><a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a> | <a href="Reference-manual_returned_file.html"><ins><code>file</code></ins></a> | <a href="Reference-manual_returned_external_program.html"><ins><code>external_program</code></ins></a></code>.</p>
<p>Additional arguments</p>
<p><em>(since 0.55.0)</em> The output of <a href="Reference-manual_functions.html#configure_file"><ins><code>configure_file()</code></ins></a>, <a href="Reference-manual_functions.html#files"><ins><code>files()</code></ins></a>, and <a href="Reference-manual_functions.html#find_program"><ins><code>find_program()</code></ins></a>
as well as strings are accepted.</p>
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.49.0)</em></p>
</div>
<p style="padding: 5px; margin: 0px;"></p> <!-- Extra space -->
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesonadd_install_script">meson.add_install_script()</h3>
<p>Causes the script given as an argument to be run during the install step,
this script will have the environment variables <code>MESON_SOURCE_ROOT</code>,
<code>MESON_BUILD_ROOT</code>, <code>MESON_INSTALL_PREFIX</code>,
<code>MESON_INSTALL_DESTDIR_PREFIX</code>, and <code>MESONINTROSPECT</code> set.
All positional arguments are passed as parameters.</p>
<p><em>(since 0.54.0)</em> If <code>meson install</code> is called with the <code>--quiet</code> option, the
environment variable <code>MESON_INSTALL_QUIET</code> will be set.</p>
<p><em>(since 1.1.0)</em> If <code>meson install</code> is called with the <code>--dry-run</code> option, the
environment variable <code>MESON_INSTALL_DRY_RUN</code> will be set.</p>
<p>Meson uses the <code>DESTDIR</code> environment variable as set by the
inherited environment to determine the (temporary) installation
location for files. Your install script must be aware of this while
manipulating and installing files. The correct way to handle this is
with the <code>MESON_INSTALL_DESTDIR_PREFIX</code> variable which is always set
and contains <code>DESTDIR</code> (if set) and <code>prefix</code> joined together. This
is useful because both are usually absolute paths and there are
platform-specific edge-cases in joining two absolute paths.</p>
<p>In case it is needed, <code>MESON_INSTALL_PREFIX</code> is also always set and
has the value of the <code>prefix</code> option passed to Meson.</p>
<p><code>MESONINTROSPECT</code> contains the path to the introspect command that
corresponds to the <code>meson</code> executable that was used to configure the
build. (This might be a different path than the first executable
found in <code>PATH</code>.) It can be used to query build configuration. Note
that the value will contain many parts, f.ex., it may be <code>python3 /path/to/meson.py introspect</code>. The user is responsible for splitting
the string to an array if needed by splitting lexically like a UNIX
shell would. If your script uses Python, <code>shlex.split()</code> is the
easiest correct way to do this.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature2">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
</div>
</div>
</div>
<pre><code class="language-meson"># Causes the script given as an argument to be run during the install step,
<a href="Reference-manual_elementary_void.html"><ins>void</ins></a> add_install_script(
<a href="Reference-manual_elementary_str.html"><ins>str</ins></a> | <a href="Reference-manual_returned_file.html"><ins>file</ins></a> | <a href="Reference-manual_returned_external_program.html"><ins>external_program</ins></a> | <a href="Reference-manual_returned_exe.html"><ins>exe</ins></a> | <a href="Reference-manual_returned_custom_tgt.html"><ins>custom_tgt</ins></a> | <a href="Reference-manual_returned_custom_idx.html"><ins>custom_idx</ins></a> <a href="Reference-manual_builtin_meson.html#add_install_script_script_name"><b>script_name</b></a>, # The script to execute
<a href="Reference-manual_elementary_str.html"><ins>str</ins></a> | <a href="Reference-manual_returned_file.html"><ins>file</ins></a> | <a href="Reference-manual_returned_external_program.html"><ins>external_program</ins></a> | <a href="Reference-manual_returned_exe.html"><ins>exe</ins></a> | <a href="Reference-manual_returned_custom_tgt.html"><ins>custom_tgt</ins></a> | <a href="Reference-manual_returned_custom_idx.html"><ins>custom_idx</ins></a> <b>arg</b>..., # Additional arguments
# Keyword arguments:
<a href="Reference-manual_builtin_meson.html#add_install_script_dry_run"><b>dry_run</b></a> : <a href="Reference-manual_elementary_bool.html"><ins>bool</ins></a> # If `true` the script will be run even if `--dry-run` option is provided to
<a href="Reference-manual_builtin_meson.html#add_install_script_install_tag"><b>install_tag</b></a> : <a href="Reference-manual_elementary_str.html"><ins>str</ins></a> # A string used by the `meson install --tags` command
<a href="Reference-manual_builtin_meson.html#add_install_script_skip_if_destdir"><b>skip_if_destdir</b></a> : <a href="Reference-manual_elementary_bool.html"><ins>bool</ins></a> # If `true` the script will not be run if DESTDIR is set during installation
)</code></pre>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit more space -->
<h4 id="arguments2">Arguments</h4>
<p>The method <code>meson.add_install_script()</code> accepts the following positional arguments:</p>
<!-- Hotdoc / markdown inserts <p> around the table elements. Override the margin to make them invisible -->
<style>
.nomargin p:last-child { margin-bottom: 0px !important; }
</style>
<table>
<thead>
<tr>
<th style="white-space: nowrap; text-align: center;">Name</th>
<th style="white-space: nowrap; text-align: center;">Type</th>
<th style="width: 56%;">Description</th>
<th style="white-space: nowrap; text-align: center; width: 0px;">Tags</th>
</tr>
</thead>
<tbody class="nomargin">
<tr id="add_install_script_script_name">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">script_name</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;">
<a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a> | <a href="Reference-manual_returned_file.html"><ins><code>file</code></ins></a> | <a href="Reference-manual_returned_external_program.html"><ins><code>external_program</code></ins></a> | <a href="Reference-manual_returned_exe.html"><ins><code>exe</code></ins></a> | <a href="Reference-manual_returned_custom_tgt.html"><ins><code>custom_tgt</code></ins></a> | <a href="Reference-manual_returned_custom_idx.html"><ins><code>custom_idx</code></ins></a>
</td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>The script to execute.</p>
<p><em>(since 0.55.0)</em> The output of <a href="Reference-manual_functions.html#find_program"><ins><code>find_program()</code></ins></a>, <a href="Reference-manual_functions.html#executable"><ins><code>executable()</code></ins></a>,
<a href="Reference-manual_functions.html#custom_target"><ins><code>custom_target()</code></ins></a>, as well as strings are accepted.</p>
<p><em>(since 0.57.0)</em> <a href="Reference-manual_returned_file.html"><ins><code>file</code></ins></a> objects and the output of <a href="Reference-manual_functions.html#configure_file"><ins><code>configure_file()</code></ins></a> may be used.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
</div>
</td>
</tr>
</tbody>
</table>
<p style="padding: 5px; margin: 0px;"></p> <!-- Extra space -->
<p>Additionally, the
method accepts between <code>0</code> and <code>infinity</code> variadic
arguments (<code>arg...</code>) of type <code><a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a> | <a href="Reference-manual_returned_file.html"><ins><code>file</code></ins></a> | <a href="Reference-manual_returned_external_program.html"><ins><code>external_program</code></ins></a> | <a href="Reference-manual_returned_exe.html"><ins><code>exe</code></ins></a> | <a href="Reference-manual_returned_custom_tgt.html"><ins><code>custom_tgt</code></ins></a> | <a href="Reference-manual_returned_custom_idx.html"><ins><code>custom_idx</code></ins></a></code>.</p>
<p>Additional arguments</p>
<p><em>(since 0.55.0)</em> The output of <a href="Reference-manual_functions.html#find_program"><ins><code>find_program()</code></ins></a>, <a href="Reference-manual_functions.html#executable"><ins><code>executable()</code></ins></a>,
<a href="Reference-manual_functions.html#custom_target"><ins><code>custom_target()</code></ins></a>, as well as strings are accepted.</p>
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.49.0)</em></p>
</div>
<p style="padding: 5px; margin: 0px;"></p> <!-- Extra space -->
<p>Finally, <code>meson.add_install_script()</code>
accepts the following keyword arguments:</p>
<!-- Hotdoc / markdown inserts <p> around the table elements. Override the margin to make them invisible -->
<style>
.nomargin p:last-child { margin-bottom: 0px !important; }
</style>
<table>
<thead>
<tr>
<th style="white-space: nowrap; text-align: center;">Name</th>
<th style="white-space: nowrap; text-align: center;">Type</th>
<th style="width: 56%;">Description</th>
<th style="white-space: nowrap; text-align: center; width: 0px;">Tags</th>
</tr>
</thead>
<tbody class="nomargin">
<tr id="add_install_script_dry_run">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">dry_run</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;"><a href="Reference-manual_elementary_bool.html"><ins><code>bool</code></ins></a></td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>If <code>true</code> the script will be run even if <code>--dry-run</code> option is provided to
the <code>meson install</code> command. The script can use the <code>MESON_INSTALL_DRY_RUN</code>
variable to determine if it is in dry run mode or not.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 1.1.0)</em></p>
<p style="margin: 0px;"><code class="language-meson">default =
false</code></p>
</div>
</td>
</tr>
<tr id="add_install_script_install_tag">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">install_tag</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;"><a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a></td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>A string used by the <code>meson install --tags</code> command
to install only a subset of the files.
By default the script has no install tag which means it is not being run when
<code>meson install --tags</code> argument is specified.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.60.0)</em></p>
</div>
</td>
</tr>
<tr id="add_install_script_skip_if_destdir">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">skip_if_destdir</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;"><a href="Reference-manual_elementary_bool.html"><ins><code>bool</code></ins></a></td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>If <code>true</code> the script will not be run if DESTDIR is set during installation.
This is useful in the case the script updates system wide
cache that is only needed when copying files into final destination.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.57.0)</em></p>
<p style="margin: 0px;"><code class="language-meson">default =
false</code></p>
</div>
</td>
</tr>
</tbody>
</table>
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesonadd_postconf_script">meson.add_postconf_script()</h3>
<p>Runs the given command after all project files have been generated.
This script will have the environment variables
<code>MESON_SOURCE_ROOT</code> and <code>MESON_BUILD_ROOT</code> set.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature3">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
</div>
</div>
</div>
<pre><code class="language-meson"># Runs the given command after all project files have been generated
<a href="Reference-manual_elementary_void.html"><ins>void</ins></a> add_postconf_script(
<a href="Reference-manual_elementary_str.html"><ins>str</ins></a> | <a href="Reference-manual_returned_file.html"><ins>file</ins></a> | <a href="Reference-manual_returned_external_program.html"><ins>external_program</ins></a> <a href="Reference-manual_builtin_meson.html#add_postconf_script_script_name"><b>script_name</b></a>, # The script to execute
<a href="Reference-manual_elementary_str.html"><ins>str</ins></a> | <a href="Reference-manual_returned_file.html"><ins>file</ins></a> | <a href="Reference-manual_returned_external_program.html"><ins>external_program</ins></a> <b>arg</b>..., # Additional arguments
)</code></pre>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit more space -->
<h4 id="arguments3">Arguments</h4>
<p>The method <code>meson.add_postconf_script()</code> accepts the following positional arguments:</p>
<!-- Hotdoc / markdown inserts <p> around the table elements. Override the margin to make them invisible -->
<style>
.nomargin p:last-child { margin-bottom: 0px !important; }
</style>
<table>
<thead>
<tr>
<th style="white-space: nowrap; text-align: center;">Name</th>
<th style="white-space: nowrap; text-align: center;">Type</th>
<th style="width: 56%;">Description</th>
<th style="white-space: nowrap; text-align: center; width: 0px;">Tags</th>
</tr>
</thead>
<tbody class="nomargin">
<tr id="add_postconf_script_script_name">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">script_name</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;">
<a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a> | <a href="Reference-manual_returned_file.html"><ins><code>file</code></ins></a> | <a href="Reference-manual_returned_external_program.html"><ins><code>external_program</code></ins></a>
</td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>The script to execute.</p>
<p><em>(since 0.55.0)</em> The output of <a href="Reference-manual_functions.html#find_program"><ins><code>find_program()</code></ins></a> as well as strings are accepted.</p>
<p><em>(since 0.57.0)</em> <a href="Reference-manual_returned_file.html"><ins><code>file</code></ins></a> objects and the output of <a href="Reference-manual_functions.html#configure_file"><ins><code>configure_file()</code></ins></a> may be used.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
</div>
</td>
</tr>
</tbody>
</table>
<p style="padding: 5px; margin: 0px;"></p> <!-- Extra space -->
<p>Additionally, the
method accepts between <code>0</code> and <code>infinity</code> variadic
arguments (<code>arg...</code>) of type <code><a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a> | <a href="Reference-manual_returned_file.html"><ins><code>file</code></ins></a> | <a href="Reference-manual_returned_external_program.html"><ins><code>external_program</code></ins></a></code>.</p>
<p>Additional arguments</p>
<p><em>(since 0.55.0)</em> The output of <a href="Reference-manual_functions.html#configure_file"><ins><code>configure_file()</code></ins></a>, <a href="Reference-manual_functions.html#files"><ins><code>files()</code></ins></a>, and <a href="Reference-manual_functions.html#find_program"><ins><code>find_program()</code></ins></a>
as well as strings are accepted.</p>
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.49.0)</em></p>
</div>
<p style="padding: 5px; margin: 0px;"></p> <!-- Extra space -->
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesonbackend">meson.backend()</h3>
<p>Returns a string representing the current backend:</p>
<ul>
<li><code>ninja</code></li>
<li><code>vs2010</code></li>
<li><code>vs2012</code></li>
<li><code>vs2013</code></li>
<li><code>vs2015</code></li>
<li><code>vs2017</code></li>
<li><code>vs2019</code></li>
<li><code>vs2022</code></li>
<li><code>xcode</code></li>
</ul>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature4">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.37.0)</em></p>
</div>
</div>
</div>
<pre><code class="language-meson"><a href="Reference-manual_elementary_str.html"><ins>str</ins></a> backend()</code></pre>
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesonbuild_options">meson.build_options()</h3>
<p>Returns a string with the configuration line used to set the current project up.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature5">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 1.1.0)</em></p>
</div>
</div>
</div>
<pre><code class="language-meson"><a href="Reference-manual_elementary_str.html"><ins>str</ins></a> build_options()</code></pre>
<div class="alert alert-info">
<strong>Note:</strong>
<p><strong>Do not try to parse this string!</strong></p>
<p>You should use <a href="Reference-manual_returned_cfg_data.html#cfg_dataset_quoted"><ins><code>cfg_data.set_quoted()</code></ins></a> to safely escape any embedded
quotes prior to storing it into e.g. a C header macro.</p>
<p>The contents returned by this function are the same as the
"Build Options:" line reported in <code><builddir>/meson-logs/meson-log.txt</code>.</p>
</div>
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesonbuild_root">meson.build_root()</h3>
<p>Returns a string with the absolute path to the build root directory.
This function will return the
build root of the parent project if called from a subproject, which is usually
not what you want. Try using <a href="Reference-manual_builtin_meson.html#mesoncurrent_build_dir"><ins><code>meson.current_build_dir()</code></ins></a> or <a href="Reference-manual_builtin_meson.html#mesonproject_build_root"><ins><code>meson.project_build_root()</code></ins></a>.
In the rare cases where the root of the main project is needed,
use <a href="Reference-manual_builtin_meson.html#mesonglobal_build_root"><ins><code>meson.global_build_root()</code></ins></a> that has the same behaviour but with a more explicit
name.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature6">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
<div style="color: #ffa844">
<p style="margin: 0px;"><strong>DEPRECATED</strong></p>
<p style="margin: 0px;"><em>in 0.56.0</em></p>
</div>
</div>
</div>
</div>
<pre><code class="language-meson"><a href="Reference-manual_elementary_str.html"><ins>str</ins></a> build_root()</code></pre>
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesoncan_run_host_binaries">meson.can_run_host_binaries()</h3>
<p>Returns true if the build machine can run binaries compiled for the host.
This returns <code>true</code> unless you are
cross compiling, need a helper to run host binaries, and don't have one.
For example when cross compiling from Linux to Windows, one can use <code>wine</code>
as the helper.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature7">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.55.0)</em></p>
</div>
</div>
</div>
<pre><code class="language-meson"><a href="Reference-manual_elementary_bool.html"><ins>bool</ins></a> can_run_host_binaries()</code></pre>
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesoncurrent_build_dir">meson.current_build_dir()</h3>
<p>Returns a string with the absolute path to the current build directory.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature8">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
</div>
</div>
</div>
<pre><code class="language-meson"><a href="Reference-manual_elementary_str.html"><ins>str</ins></a> current_build_dir()</code></pre>
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesoncurrent_source_dir">meson.current_source_dir()</h3>
<p>Returns a string to the current source directory.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature9">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
</div>
</div>
</div>
<pre><code class="language-meson"><a href="Reference-manual_elementary_str.html"><ins>str</ins></a> current_source_dir()</code></pre>
<div class="alert alert-info">
<strong>Note:</strong>
<p><strong>You do not need to use this function!</strong></p>
<p>When passing files from the current source directory to a function since
that is the default. Also, you can use the <a href="Reference-manual_functions.html#files"><ins><code>files()</code></ins></a> function to
refer to files in the current or any other source directory instead
of constructing paths manually with <a href="Reference-manual_builtin_meson.html#mesoncurrent_source_dir"><ins><code>meson.current_source_dir()</code></ins></a>.</p>
</div>
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesonget_compiler">meson.get_compiler()</h3>
<p>Returns a <a href="Reference-manual_returned_compiler.html"><ins><code>compiler</code></ins></a> object describing a compiler.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature10">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
</div>
</div>
</div>
<pre><code class="language-meson"># Returns a <a href="Reference-manual_returned_compiler.html"><ins><code>compiler</code></ins></a> object describing a compiler.
<a href="Reference-manual_returned_compiler.html"><ins>compiler</ins></a> get_compiler(
<a href="Reference-manual_elementary_str.html"><ins>str</ins></a> <a href="Reference-manual_builtin_meson.html#get_compiler_language"><b>language</b></a>, # The language of the compiler to return
# Keyword arguments:
<a href="Reference-manual_builtin_meson.html#get_compiler_native"><b>native</b></a> : <a href="Reference-manual_elementary_bool.html"><ins>bool</ins></a> # When set to `true` Meson returns the compiler for the build
)</code></pre>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit more space -->
<h4 id="arguments4">Arguments</h4>
<p>The method <code>meson.get_compiler()</code> accepts the following positional arguments:</p>
<!-- Hotdoc / markdown inserts <p> around the table elements. Override the margin to make them invisible -->
<style>
.nomargin p:last-child { margin-bottom: 0px !important; }
</style>
<table>
<thead>
<tr>
<th style="white-space: nowrap; text-align: center;">Name</th>
<th style="white-space: nowrap; text-align: center;">Type</th>
<th style="width: 56%;">Description</th>
<th style="white-space: nowrap; text-align: center; width: 0px;">Tags</th>
</tr>
</thead>
<tbody class="nomargin">
<tr id="get_compiler_language">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">language</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;"><a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a></td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>The language of the compiler to return.</p>
<p>See our <a href="Reference-tables.html#language-arguments-parameter-names">list of supported languages</a>.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
</div>
</td>
</tr>
</tbody>
</table>
<p style="padding: 5px; margin: 0px;"></p> <!-- Extra space -->
<p>Finally, <code>meson.get_compiler()</code>
accepts the following keyword arguments:</p>
<!-- Hotdoc / markdown inserts <p> around the table elements. Override the margin to make them invisible -->
<style>
.nomargin p:last-child { margin-bottom: 0px !important; }
</style>
<table>
<thead>
<tr>
<th style="white-space: nowrap; text-align: center;">Name</th>
<th style="white-space: nowrap; text-align: center;">Type</th>
<th style="width: 56%;">Description</th>
<th style="white-space: nowrap; text-align: center; width: 0px;">Tags</th>
</tr>
</thead>
<tbody class="nomargin">
<tr id="get_compiler_native">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">native</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;"><a href="Reference-manual_elementary_bool.html"><ins><code>bool</code></ins></a></td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>When set to <code>true</code> Meson returns the compiler for the build
machine (the "native" compiler) and when <code>false</code> it returns the host
compiler (the "cross" compiler). If <code>native</code> is omitted, Meson
returns the "cross" compiler if we're currently cross-compiling and
the "native" compiler if we're not.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><code class="language-meson">default =
false</code></p>
</div>
</td>
</tr>
</tbody>
</table>
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesonget_cross_property">meson.get_cross_property()</h3>
<p>Returns the given property from a cross file, the optional fallback_value
is returned if not cross compiling or the given property is not found.</p>
<p>This method is replaced by <a href="Reference-manual_builtin_meson.html#mesonget_external_property"><ins><code>meson.get_external_property()</code></ins></a>.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature11">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
<div style="color: #ffa844">
<p style="margin: 0px;"><strong>DEPRECATED</strong></p>
<p style="margin: 0px;"><em>in 0.58.0</em></p>
</div>
</div>
</div>
</div>
<pre><code class="language-meson"># Returns the given property from a cross file, the optional fallback_value
<a href="Reference-manual_elementary_any.html"><ins>any</ins></a> get_cross_property(
<a href="Reference-manual_elementary_str.html"><ins>str</ins></a> <a href="Reference-manual_builtin_meson.html#get_cross_property_propname"><b>propname</b></a>, # Name of the property in the cross / native file
<a href="Reference-manual_elementary_any.html"><ins>any</ins></a> [<a href="Reference-manual_builtin_meson.html#get_cross_property_fallback_value"><b>fallback_value</b></a>], # Value to return if `propname` is not set in the machine file
)</code></pre>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit more space -->
<h4 id="arguments5">Arguments</h4>
<p><a href="Syntax.html#argument-flattening">Argument flattening</a> is <strong>NOT SUPPORTED</strong> by this function.</p>
<p>The method <code>meson.get_cross_property()</code> accepts the following positional arguments:</p>
<!-- Hotdoc / markdown inserts <p> around the table elements. Override the margin to make them invisible -->
<style>
.nomargin p:last-child { margin-bottom: 0px !important; }
</style>
<table>
<thead>
<tr>
<th style="white-space: nowrap; text-align: center;">Name</th>
<th style="white-space: nowrap; text-align: center;">Type</th>
<th style="width: 56%;">Description</th>
<th style="white-space: nowrap; text-align: center; width: 0px;">Tags</th>
</tr>
</thead>
<tbody class="nomargin">
<tr id="get_cross_property_propname">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">propname</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;"><a href="Reference-manual_elementary_str.html"><ins><code>str</code></ins></a></td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>Name of the property in the cross / native file.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
</div>
</td>
</tr>
<tr id="get_cross_property_fallback_value">
<td style="white-space: nowrap; text-align: center; padding: 6px;"><code class="language-meson">fallback_value</code></td>
<td style="white-space: revert; text-align: center; padding: 6px; word-wrap: break-word;"><a href="Reference-manual_elementary_any.html"><ins><code>any</code></ins></a></td>
<!-- This suboptimal formatting is required to ensure hotdoc correctly generates the HTML -->
<td style="width: 56%; padding: 6px;">
<p>Value to return if <code>propname</code> is not set in the machine file.</p>
</td>
<td style="white-space: nowrap; text-align: center; padding: 6px; width: 0px;">
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><b>[optional]</b></p>
</div>
</td>
</tr>
</tbody>
</table>
<p style="padding: 5px; margin: 0px;"></p> <!-- Extra space -->
<p style="padding: 7.5px; margin: 0px;"></p>
<hr>
<p style="padding: 7.5px; margin: 0px;"></p>
<h3 id="mesonget_external_property">meson.get_external_property()</h3>
<p>Returns the given property from a native or cross file.
The optional fallback_value is returned if the given property is not found.</p>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit of space because we remove the top margin below -->
<div style="display: flex;">
<h4 style="margin-top: 0px;" id="signature12">Signature</h4>
<div style="flex-grow: 1;"></div>
<div>
<div style="margin: 0px; text-align: center;">
<p style="margin: 0px;"><em style="color: #5affff;">(since 0.54.0)</em></p>
</div>
</div>
</div>
<pre><code class="language-meson"># Returns the given property from a native or cross file
<a href="Reference-manual_elementary_any.html"><ins>any</ins></a> get_external_property(
<a href="Reference-manual_elementary_str.html"><ins>str</ins></a> <a href="Reference-manual_builtin_meson.html#get_external_property_propname"><b>propname</b></a>, # Name of the property in the cross / native file
<a href="Reference-manual_elementary_any.html"><ins>any</ins></a> [<a href="Reference-manual_builtin_meson.html#get_external_property_fallback_value"><b>fallback_value</b></a>], # Value to return if `propname` is not set in the machine file
# Keyword arguments:
<a href="Reference-manual_builtin_meson.html#get_external_property_native"><b>native</b></a> : <a href="Reference-manual_elementary_bool.html"><ins>bool</ins></a> # Setting `native` to `true` forces retrieving a variable from the
)</code></pre>
<p style="padding: 5px; margin: 0px;"></p> <!-- A bit more space -->
<h4 id="arguments6">Arguments</h4>
<p><a href="Syntax.html#argument-flattening">Argument flattening</a> is <strong>NOT SUPPORTED</strong> by this function.</p>
<p>The method <code>meson.get_external_property()</code> accepts the following positional arguments:</p>
<!-- Hotdoc / markdown inserts <p> around the table elements. Override the margin to make them invisible -->
<style>
.nomargin p:last-child { margin-bottom: 0px !important; }
</style>
<table>
<thead>
<tr>
<th style="white-space: nowrap; text-align: center;">Name</th>
<th style="white-space: nowrap; text-align: center;">Type</th>