aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2019-12-11 16:19:10 -0500
committerXavier Claessens <xavier.claessens@collabora.com>2019-12-12 18:30:17 -0500
commit6e865a233099a00e9ea08f6a2f911ede3c7b4215 (patch)
tree49f0e3f610cce931c9e75f54c2ee95092337e53a /docs/markdown/snippets
parent17dd9e5bffd42c3ad6c2dff1f15639d6adf31e1c (diff)
downloadmeson-6e865a233099a00e9ea08f6a2f911ede3c7b4215.zip
meson-6e865a233099a00e9ea08f6a2f911ede3c7b4215.tar.gz
meson-6e865a233099a00e9ea08f6a2f911ede3c7b4215.tar.bz2
Add a summary() function for configuration summarization
Based on patch from Dylan Baker. Fixes #757
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/summary.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/markdown/snippets/summary.md b/docs/markdown/snippets/summary.md
new file mode 100644
index 0000000..c5d64fd
--- /dev/null
+++ b/docs/markdown/snippets/summary.md
@@ -0,0 +1,37 @@
+## Add a new summary() function
+
+A new function [`summary()`](Reference-manual.md#summary) has been added to
+summarize build configuration at the end of the build process.
+
+Example:
+```meson
+project('My Project', version : '1.0')
+summary('Directories', {'bindir': get_option('bindir'),
+ 'libdir': get_option('libdir'),
+ 'datadir': get_option('datadir'),
+ })
+summary('Configuration', {'Some boolean': false,
+ 'Another boolean': true,
+ 'Some string': 'Hello World',
+ 'A list': ['string', 1, true],
+ })
+```
+
+Output:
+```
+My Project 1.0
+
+ Directories
+ prefix: /opt/gnome
+ bindir: bin
+ libdir: lib/x86_64-linux-gnu
+ datadir: share
+
+ Configuration
+ Some boolean: False
+ Another boolean: True
+ Some string: Hello World
+ A list: string
+ 1
+ True
+```