diff options
-rw-r--r-- | meson.build | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/meson.build b/meson.build index 5a77785b8c..79843c7319 100644 --- a/meson.build +++ b/meson.build @@ -246,10 +246,6 @@ foreach arg : ['-Wundef', '-Wendif-labels', '-Wstrict-aliasing=2', '-Wwrite-strings', - '-Wno-unused-parameter', - '-Wno-missing-field-initializers', - '-Wno-unused-result', - '-Wno-format-signedness', '-Werror=overflow', '-Wdate-time', '-Wnested-externs', @@ -268,6 +264,17 @@ foreach arg : ['-Wundef', endif endforeach +# "negative" arguments: gcc on purpose does not return an error for "-Wno-" +# arguments, just emits a warnings. So test for the "positive" version instead. +foreach arg : ['unused-parameter', + 'missing-field-initializers', + 'unused-result', + 'format-signedness'] + if cc.has_argument('-W' + arg) + add_project_arguments('-Wno-' + arg, language : 'c') + endif +endforeach + if cc.compiles(' #include <time.h> #include <inttypes.h> @@ -614,13 +621,19 @@ libm = cc.find_library('m') libdl = cc.find_library('dl') libcrypt = cc.find_library('crypt') -libcap = dependency('libcap') +libcap = dependency('libcap', required : false) +if not libcap.found() + # Compat with Ubuntu 14.04 which ships libcap w/o .pc file + libcap = cc.find_library('cap') +endif + libmount = dependency('mount', version : '>= 2.27') want_seccomp = get_option('seccomp') if want_seccomp != 'false' libseccomp = dependency('libseccomp', + version : '>= 2.3.1', required : want_seccomp == 'true') if libseccomp.found() conf.set('HAVE_SECCOMP', 1) |