summaryrefslogtreecommitdiff
path: root/docs/markdown/snippets/compiler-object-run_command.md
blob: 0308416e5b1cf0ef4db80187810f87f9cbcf5747 (plain)
1
2
3
4
5
6
7
8
9
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()