diff options
author | Daniel Stone <daniels@collabora.com> | 2017-04-12 16:00:48 +0100 |
---|---|---|
committer | Daniel Stone <daniels@collabora.com> | 2017-08-31 20:24:20 +0100 |
commit | e1ffae0580259343be7665c6b2f014fe71b8c05c (patch) | |
tree | 24462ab941900841b2d1e320e2c02fbef0dd992e /docs/markdown/Reference-manual.md | |
parent | 7fb1973caca249e284ba6bec7e7a7b2439f9721f (diff) | |
download | meson-e1ffae0580259343be7665c6b2f014fe71b8c05c.zip meson-e1ffae0580259343be7665c6b2f014fe71b8c05c.tar.gz meson-e1ffae0580259343be7665c6b2f014fe71b8c05c.tar.bz2 |
Add Compiler.get_supported_arguments()
Add a helper for the common pattern of:
args_to_use = []
foreach arg : candidate_args
if cc.has_argument(arg)
args_to_use += arg
endif
endforeach
Replaced with:
args_to_use = cc.get_supported_arguments(candidate_args)
Diffstat (limited to 'docs/markdown/Reference-manual.md')
-rw-r--r-- | docs/markdown/Reference-manual.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 91f7edd..e388878 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1286,6 +1286,10 @@ the following methods: - `get_id()` returns a string identifying the compiler. For example, `gcc`, `msvc`, [and more](Compiler-properties.md#compiler-id). +- `get_supported_arguments(list_of_string)` returns an array + containing only the arguments supported by the compiler, as if + `has_argument` were called on them individually. + - `compiles(code)` returns true if the code fragment given in the positional argument compiles, you can specify external dependencies to use with `dependencies` keyword argument, `code` can be either a |