Add coverity flag to fix builds for coverity
authorJonathan Dieter <jdieter@gmail.com>
Fri, 14 Sep 2018 12:00:33 +0000 (13:00 +0100)
committerJonathan Dieter <jdieter@gmail.com>
Fri, 14 Sep 2018 12:00:33 +0000 (13:00 +0100)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
.gitignore
meson.build
meson_options.txt

index 7e6710b8e56dadf2a0226e6f0da1095b0f27ce8e..18d405fabb575ca5dbd5c4935916e29323c5821d 100644 (file)
@@ -1,3 +1,4 @@
+cov-int
 build
 test/abi/new
 test/abi/stable/ABI.dump
index 15c9cb404d842693fdb4282aaca8ff9a8741d6f2..aae1748e0fbe27646abda97cb718df9e501fe953 100644 (file)
@@ -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,
index 0f9d7c178edda34c2127b60dc8e3ef19052b5521..7dc221e4faecdd5434c4b6db53e67f962a2fa476 100644 (file)
@@ -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)