From 4dc4a02a770e49fd33cba9712d7d0cf2288f945c Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Fri, 14 Sep 2018 13:00:33 +0100 Subject: [PATCH] Add coverity flag to fix builds for coverity Signed-off-by: Jonathan Dieter --- .gitignore | 1 + meson.build | 13 ++++++++++++- meson_options.txt | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7e6710b..18d405f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +cov-int build test/abi/new test/abi/stable/ABI.dump diff --git a/meson.build b/meson.build index 15c9cb4..aae1748 100644 --- a/meson.build +++ b/meson.build @@ -11,6 +11,15 @@ common_cflags = [ cc = meson.get_compiler('c') add_project_arguments(cc.get_supported_arguments(common_cflags), language : 'c') +# Fix coverity bug, shamelessly stolen from libinput +if get_option('coverity') + add_project_arguments('-D_Float128=__uint128_t', language : 'c') + add_project_arguments('-D_Float32x=int', language : 'c') + add_project_arguments('-D_Float32=int', language : 'c') + add_project_arguments('-D_Float64x=long', language : 'c') + add_project_arguments('-D_Float64=long', language : 'c') +endif + if get_option('with-zstd') == 'disabled' zstd_dep = dependency('', required : false) else @@ -35,7 +44,9 @@ inc = include_directories('include') subdir('include') subdir('src') -subdir('test') +if not get_option('coverity') + subdir('test') +endif pkg_mod = import('pkgconfig') pkg_mod.generate(libraries : zcklib, diff --git a/meson_options.txt b/meson_options.txt index 0f9d7c1..7dc221e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,3 @@ option('with-zstd', type : 'combo', choices : ['enabled', 'disabled', 'auto'], value : 'auto') option('with-openssl', type : 'combo', choices : ['enabled', 'disabled', 'auto'], value : 'auto') +option('coverity', type : 'boolean', value : false) -- 2.30.2