To avoid manual compiler support checks add_project_arguments and add_global_arguments receive a new keyword argument to perform them automatically.pull/8898/head
parent
2e8729a7e6
commit
c9ad98ef5e
5 changed files with 35 additions and 2 deletions
@ -0,0 +1,8 @@ |
||||
# Required project & global arguments |
||||
|
||||
The `add_global_arguments` & `add_project_arguments` functions now |
||||
support an optional keyword argument named `required`. Setting it |
||||
to `true` will cause Meson to perform compiler support checks on |
||||
each of the passed arguments as if by calling `has_argument`, which |
||||
means manual checks can now be avoided and instead expressed more |
||||
tersely. |
@ -0,0 +1,3 @@ |
||||
project('add_project_arguments test', 'c') |
||||
|
||||
add_project_arguments('-meson-goober-arg-for-testing', language : 'c', required : true) |
@ -0,0 +1,7 @@ |
||||
{ |
||||
"stdout": [ |
||||
{ |
||||
"line": "test cases/failing/115 required project arguments/meson.build:3:0: ERROR: C compiler does not support \"-meson-goober-arg-for-testing\"" |
||||
} |
||||
] |
||||
} |
Loading…
Reference in new issue