]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Enforce sqlite dependency for liblastlog2
authorJordan Williams <jordan@jwillikers.com>
Mon, 8 Apr 2024 13:30:24 +0000 (08:30 -0500)
committerJordan Williams <jordan@jwillikers.com>
Mon, 8 Apr 2024 13:30:24 +0000 (08:30 -0500)
liblastlog2 requires the sqlite dependency.
Currently, Meson enforces this dependency to be available only when the
build-liblastlog2 feature is explicitly enabled.
liblastlog2 is built by default, so if sqlite is not available, the
build will be configured correctly, but fail to compile.
This commit fixes this case by automatically disabling the
build-liblastlog2 feature when it is auto and sqlite is not found.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
meson.build

index e65cd9582f9bc164aa459cd193ef1d4835985873..58d75135a27c278a7dc11a7dfdc2e5c630344ea4 100644 (file)
@@ -86,7 +86,8 @@ build_libuuid = not get_option('build-libuuid').disabled()
 conf.set('HAVE_LIBUUID', build_libuuid ? 1 : false)
 summary('libuuid', build_libuuid ? 'enabled' : 'disabled', section : 'components')
 
-build_liblastlog2 = not get_option('build-liblastlog2').disabled()
+lib_sqlite3 = dependency('sqlite3', required : get_option('build-liblastlog2'))
+build_liblastlog2 = get_option('build-liblastlog2').require(lib_sqlite3.found()).allowed()
 conf.set('HAVE_LIBLASTLOG2', build_liblastlog2 ? 1 : false)
 summary('liblastlog2', build_liblastlog2 ? 'enabled' : 'disabled', section : 'components')
 
@@ -430,7 +431,6 @@ conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false)
 
 conf.set('HAVE_SMACK', not get_option('smack').disabled())
 
-lib_sqlite3 = dependency('sqlite3', required : get_option('build-liblastlog2'))
 
 foreach header : headers
   have = cc.has_header(header)