[PATCH] meson: be strict for boolean options

Anton Kochkov posted 1 patch 1 year, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220813121400.1995447-1-anton.kochkov@proton.me
There is a newer version of this series
meson_options.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] meson: be strict for boolean options
Posted by Anton Kochkov 1 year, 8 months ago
While Meson buildsystem accepts the 'false' as a value
for boolean options, it's not covered by the specification
and in general invalid. Some alternative Meson implementations,
like Muon, do not accept 'false' or 'true' as a valid value
for the boolean options.

See https://mesonbuild.com/Build-options.html

Signed-off-by: Anton Kochkov <anton.kochkov@proton.me>
---
 meson_options.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meson_options.txt b/meson_options.txt
index e58e158396..63f0725174 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -82,9 +82,9 @@ option('tcg', type: 'feature', value: 'enabled',
        description: 'TCG support')
 option('tcg_interpreter', type: 'boolean', value: false,
        description: 'TCG with bytecode interpreter (slow)')
-option('cfi', type: 'boolean', value: 'false',
+option('cfi', type: 'boolean', value: false,
        description: 'Control-Flow Integrity (CFI)')
-option('cfi_debug', type: 'boolean', value: 'false',
+option('cfi_debug', type: 'boolean', value: false,
        description: 'Verbose errors in case of CFI violation')
 option('multiprocess', type: 'feature', value: 'auto',
        description: 'Out of process device emulation support')
--
2.37.1
Re: [PATCH] meson: be strict for boolean options
Posted by Philippe Mathieu-Daudé via 1 year, 8 months ago
On 13/8/22 14:15, Anton Kochkov wrote:
> While Meson buildsystem accepts the 'false' as a value
> for boolean options, it's not covered by the specification
> and in general invalid. Some alternative Meson implementations,
> like Muon, do not accept 'false' or 'true' as a valid value
> for the boolean options.
> 
> See https://mesonbuild.com/Build-options.html
> 
> Signed-off-by: Anton Kochkov <anton.kochkov@proton.me>
> ---
>   meson_options.txt | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meson_options.txt b/meson_options.txt
> index e58e158396..63f0725174 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -82,9 +82,9 @@ option('tcg', type: 'feature', value: 'enabled',
>          description: 'TCG support')
>   option('tcg_interpreter', type: 'boolean', value: false,
>          description: 'TCG with bytecode interpreter (slow)')
> -option('cfi', type: 'boolean', value: 'false',
> +option('cfi', type: 'boolean', value: false,
>          description: 'Control-Flow Integrity (CFI)')
> -option('cfi_debug', type: 'boolean', value: 'false',
> +option('cfi_debug', type: 'boolean', value: false,
>          description: 'Verbose errors in case of CFI violation')
>   option('multiprocess', type: 'feature', value: 'auto',
>          description: 'Out of process device emulation support')
> --
> 2.37.1
> 
> 
> 

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>