aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/compiler-object-run_command.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/markdown/snippets/compiler-object-run_command.md b/docs/markdown/snippets/compiler-object-run_command.md
new file mode 100644
index 0000000..0308416
--- /dev/null
+++ b/docs/markdown/snippets/compiler-object-run_command.md
@@ -0,0 +1,10 @@
+## Compiler object can now be passed to run_command()
+
+This can be used to run the current compiler with the specified arguments
+to obtain additional information from it.
+One of the use cases is to get the location of development files for the
+GCC plugins:
+
+ cc = meson.get_compiler('c')
+ result = run_command(cc, '-print-file-name=plugin')
+ plugin_dev_path = result.stdout().strip()