aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
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>'])
+```