]> git.proxmox.com Git - mirror_lxc.git/commitdiff
meson: Use dependencies for pkgconfig
authorStéphane Graber <stgraber@ubuntu.com>
Mon, 2 May 2022 12:21:46 +0000 (14:21 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 2 May 2022 12:40:42 +0000 (14:40 +0200)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
meson.build

index ee891b004819c3776da0c53cbd53d582f5d2a38e..2a549f3ba4e74bb65aa084d56de3b460f6cdf462 100644 (file)
@@ -206,9 +206,8 @@ threads = dependency('threads')
 ## Seccomp.
 libseccomp = dependency('libseccomp')
 conf.set10('HAVE_SECCOMP', libseccomp.found())
+pkgconfig_libs += libseccomp
 if libseccomp.found()
-    pkgconfig_libs += '-lseccomp'
-
     if libseccomp.version().version_compare('>=2.5.0')
         # https://github.com/seccomp/libseccomp/commit/dead12bc788b259b148cc4d93b970ef0bd602b1a
         conf.set10('HAVE_DECL_SECCOMP_NOTIFY_FD', true)
@@ -245,9 +244,7 @@ endif
 ## SELinux.
 libselinux = dependency('libselinux', required: false)
 conf.set10('HAVE_SELINUX', libselinux.found())
-if libselinux.found()
-    pkgconfig_libs += '-lselinux'
-endif
+pkgconfig_libs += libselinux
 
 ## AppArmor.
 libapparmor = dependency('libapparmor', required: false)
@@ -256,9 +253,7 @@ conf.set10('HAVE_APPARMOR', libapparmor.found())
 ## OpenSSL.
 libopenssl = dependency('openssl', required: false)
 conf.set10('HAVE_OPENSSL', libopenssl.found())
-if libopenssl.found()
-    pkgconfig_libs += '-lssl -lcrypto'
-endif
+pkgconfig_libs += libopenssl
 
 ## Libcap..
 libcap = dependency('libcap', required: false)
@@ -267,9 +262,7 @@ if not libcap.found()
     libcap = cc.find_library('cap', required: false)
 endif
 conf.set10('HAVE_LIBCAP', libcap.found())
-if libcap.found()
-    pkgconfig_libs += '-lcap'
-endif
+pkgconfig_libs += libcap
 
 libcap_static = dependency('libcap', required: false, static: true)
 if not libcap_static.found()
@@ -282,9 +275,7 @@ conf.set10('HAVE_STATIC_LIBCAP', libcap_static.found())
 pam = cc.find_library('pam',
     has_headers: 'security/pam_modules.h')
 conf.set10('HAVE_PAM', pam.found())
-if pam.found()
-    pkgconfig_libs += '-lpam'
-endif
+pkgconfig_libs += pam
 
 ## Others.
 have = cc.has_function('strchrnul', prefix: '#include <string.h>', args: '-D_GNU_SOURCE')