From 7180c8993edd819b3ce6d0954aea6ac54c5cb28e Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 31 Jan 2022 11:17:24 +0000 Subject: [PATCH] trivial: Turn off -fanalyzer by default This has several false positives in Fedora 36 and also slows down the build considerably. --- meson.build | 2 +- meson_options.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a9ed49e34..9afa2a8b8 100644 --- a/meson.build +++ b/meson.build @@ -108,7 +108,7 @@ warning_flags = [ '-Wvla', '-Wwrite-strings' ] -if host_machine.system() != 'windows' +if get_option('static_analysis') and host_machine.system() != 'windows' warning_flags += ['-fanalyzer', '-Wno-analyzer-null-dereference'] endif cc = meson.get_compiler('c') diff --git a/meson_options.txt b/meson_options.txt index 20c1d77cf..1b8b68aa2 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,6 @@ option('build', type : 'combo', choices : ['all', 'standalone', 'library'], value : 'all', description : 'build type') option('consolekit', type : 'boolean', value : true, description : 'enable ConsoleKit support') +option('static_analysis', type : 'boolean', value : false, description : 'enable GCC static analysis support') option('firmware-packager', type : 'boolean', value : true, description : 'enable firmware-packager installation') option('docs', type : 'combo', choices : ['none', 'gtkdoc', 'docgen'], value : 'docgen', description : 'developer documentation type') option('introspection', type : 'boolean', value : true, description : 'generate GObject Introspection data')