summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@users.noreply.github.com>2017-04-27 22:12:28 +0200
committerGitHub <noreply@github.com>2017-04-27 22:12:28 +0200
commitb13586206b2ee5b927680201a716a92244d7b3d6 (patch)
treeadd5ed406451f2e0c2441375288a5b736d998fb6 /meson.build
parent1c9f131444693c6f863a66dc5b189df037e22ff7 (diff)
parent2c5434ad3cbf7dfa8837083bcadbdc2b9a2bcaea (diff)
downloadsystemd-b13586206b2ee5b927680201a716a92244d7b3d6.tar.gz
Merge pull request #5827 from keszybz/meson-libcap
meson: fixes to allow meson builds on Ubuntu Trusty
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build23
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)