From 98c84e632676f3e8515789bacee81d3ed0888f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 11 May 2026 13:01:13 +0200 Subject: [PATCH] meson: add -Dfanalyzer=false|true When enabled, compile with -fanalyzer --- meson.build | 5 ++++- meson_options.txt | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a0e602bb..2338ceeb 100644 --- a/meson.build +++ b/meson.build @@ -96,7 +96,10 @@ add_project_arguments( cc.get_supported_arguments( ['-pedantic', '-fstrict-aliasing', - '-Wstrict-aliasing']), + '-Wstrict-aliasing']) + + (get_option('fanalyzer') + ? ['-fanalyzer'] + : []), language: 'c', ) diff --git a/meson_options.txt b/meson_options.txt index ab7a07be..e3356074 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -27,3 +27,5 @@ option('utmp-backend', type: 'combo', value: 'auto', choices: ['none', 'libutemp description: 'Which utmp logging backend to use. This affects how (with what arguments) the utmp helper binary (see \'utmp-default-helper-path\')is called. Default: auto (linux=libutempter, freebsd=ulog, others=none)') option('utmp-default-helper-path', type: 'string', value: 'auto', description: 'Default path to the utmp helper binary. Default: auto-detect') + +option('fanalyzer', type: 'boolean', value: false, description: 'enable GCC static analyzer')