aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorMarvin Scholz <epirat07@gmail.com>2022-11-22 23:20:05 +0100
committerXavier Claessens <xclaesse@gmail.com>2022-12-06 10:59:00 -0500
commit85a58f12f09795078b8bd2a26fce0465d46c36a2 (patch)
treefe30c914ae0160851d951a35b700136e815146cb /docs/markdown/snippets
parentcee7ecde3de4a338081d6856b4127f5dc268fb40 (diff)
downloadmeson-85a58f12f09795078b8bd2a26fce0465d46c36a2.zip
meson-85a58f12f09795078b8bd2a26fce0465d46c36a2.tar.gz
meson-85a58f12f09795078b8bd2a26fce0465d46c36a2.tar.bz2
interpreter: compiler: Allow array for the prefix kwarg
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/compiler_prefix_property_array.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/markdown/snippets/compiler_prefix_property_array.md b/docs/markdown/snippets/compiler_prefix_property_array.md
new file mode 100644
index 0000000..75b7156
--- /dev/null
+++ b/docs/markdown/snippets/compiler_prefix_property_array.md
@@ -0,0 +1,18 @@
+## Compiler check functions `prefix` kwargs accepts arrays
+
+The `prefix` kwarg that most compiler check functions support
+now accepts an array in addition to a string. The elements of the
+array will be concatenated separated by a newline.
+
+This makes it more readable to write checks that need multiple headers
+to be included:
+
+```meson
+cc.check_header('GL/wglew.h', prefix : ['#include <windows.h>', '#include <GL/glew.h>'])
+```
+
+instead of
+
+```meson
+cc.check_header('GL/wglew.h', prefix : '#include <windows.h>\n#include <GL/glew.h>'])
+```