diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-10-16 10:03:13 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-11-03 18:10:36 +0200 |
commit | 63f4f9481ebc865b11a06aeecf0c624104d46afd (patch) | |
tree | 13ff86bcf410ae872ebc1c33cac851104d21ecf0 /docs/markdown/Compiler-properties.md | |
parent | 8cd7f7871bc99e5ed709d4f0ec54997047f3e335 (diff) | |
download | meson-63f4f9481ebc865b11a06aeecf0c624104d46afd.zip meson-63f4f9481ebc865b11a06aeecf0c624104d46afd.tar.gz meson-63f4f9481ebc865b11a06aeecf0c624104d46afd.tar.bz2 |
Add new compiler.get_argument_syntax method
Some compilers try very had to pretend they're another compiler (ICC
pretends to be GCC and Linux and MacOS, and MSVC on windows), Clang
behaves much like GCC, but now also has clang-cl, which behaves like MSVC.
This method provides an easy way to determine whether testing for MSVC
like arguments `/w1234` or gcc like arguments `-Wfoo` are likely to
succeed, without having to check for dozens of compilers and the host
operating system, (as you would otherwise have to do with ICC).
Diffstat (limited to 'docs/markdown/Compiler-properties.md')
-rw-r--r-- | docs/markdown/Compiler-properties.md | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/docs/markdown/Compiler-properties.md b/docs/markdown/Compiler-properties.md index 1228f42..4f5ebdb 100644 --- a/docs/markdown/Compiler-properties.md +++ b/docs/markdown/Compiler-properties.md @@ -29,9 +29,17 @@ Compiler id == The compiler object has a method called `get_id`, which returns a -lower case string describing the "family" of the compiler. See -[reference tables](Reference-tables.md) for a list of supported -compiler ids. +lower case string describing the "family" of the compiler. + +The compiler object also has a method `get_argument_syntax` which +returns a lower case string of `gcc`, `msvc`, or another undefined string +value; identifying whether the compiler arguments use the same syntax as +either `gcc` or `msvc`, or that its arguments are not like either. This should +only be used to select the syntax of the arguments, such as those to test +with `has_argument`. + +See [reference tables](Reference-tables.md#compiler-ids) for a list of supported compiler +ids and their argument type. Does code compile? == |