diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-10-08 22:35:27 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-10-08 22:36:06 +0300 |
commit | 683947d9436b37041cf0bb6b02ed23e982be225f (patch) | |
tree | dd11c7446ba3bcc7c5460ce7234f072cca688ff8 /docs/markdown/snippets/get-supported-arguments.md | |
parent | 93aa32219fec2d559ae45747f67ba17a0de06002 (diff) | |
download | meson-683947d9436b37041cf0bb6b02ed23e982be225f.tar.gz |
Collated release note snippets to main file.
Diffstat (limited to 'docs/markdown/snippets/get-supported-arguments.md')
-rw-r--r-- | docs/markdown/snippets/get-supported-arguments.md | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/docs/markdown/snippets/get-supported-arguments.md b/docs/markdown/snippets/get-supported-arguments.md deleted file mode 100644 index c0cc9bfd3..000000000 --- a/docs/markdown/snippets/get-supported-arguments.md +++ /dev/null @@ -1,23 +0,0 @@ -# Easier handling of supported compiler arguments - -A common pattern for handling multiple desired compiler arguments, was to -test their presence and add them to an array one-by-one, e.g.: - - warning_flags_maybe = [ - '-Wsomething', - '-Wanother-thing', - '-Wno-the-other-thing', - ] - warning_flags = [] - foreach flag : warning_flags_maybe - if cc.has_argument(flag) - warning_flags += flag - endif - endforeach - cc.add_project_argument(warning_flags) - -A helper has been added for the foreach/has_argument pattern, so you can -now simply do: - - warning_flags = [ ... ] - flags = cc.get_supported_flags(warning_flags) |