From: Jonathan Dieter Date: Fri, 14 Sep 2018 12:00:33 +0000 (+0100) Subject: Add coverity flag to fix builds for coverity X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~127 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4dc4a02a770e49fd33cba9712d7d0cf2288f945c;p=zchunk.git Add coverity flag to fix builds for coverity Signed-off-by: Jonathan Dieter --- 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)