From 4f5c14143d62ede05644420d381321f3b4dd7934 Mon Sep 17 00:00:00 2001 From: Fred Morcos Date: Tue, 15 Aug 2023 23:40:01 +0200 Subject: [PATCH] Meson: Cleanup lua-records module --- meson.build | 2 +- meson/lua-records/meson.build | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index f8b6b8b4ef..5e5fe82641 100644 --- a/meson.build +++ b/meson.build @@ -43,7 +43,7 @@ subdir('meson' / 'pthread-headers') # Check pthread headers subdir('meson' / 'pthread-setname') # Pthread setname madness subdir('meson' / 'strerror') # Strerror_r subdir('meson' / 'lua') # Lua -subdir('meson' / 'lua-records') # Lua Records +subdir('meson' / 'lua-records') # Lua-based Records subdir('meson' / 'hardening') # Hardening subdir('meson' / 'kiss-rng') # Unsafe KISS RNG subdir('meson' / 'net-libs') # Network Libraries diff --git a/meson/lua-records/meson.build b/meson/lua-records/meson.build index 7b91ae71ed..a13cea6505 100644 --- a/meson/lua-records/meson.build +++ b/meson/lua-records/meson.build @@ -1,11 +1,7 @@ -# Lua Records -# Inputs: conf deps opt_lua dep_lua - opt_lua_records = get_option('lua-records') dep_libcurl = dependency('libcurl', version: '>= 7.21.3', required: opt_lua_records) -deps += dep_libcurl -conf.set10('HAVE_LIBCURL', dep_libcurl.found(), description: 'Whether we have libcurl') +conf.set('HAVE_LIBCURL', dep_libcurl.found(), description: 'Whether we have libcurl') opt_lua_enabled = opt_lua in ['auto', 'luajit', 'lua'] @@ -17,6 +13,20 @@ if not dep_lua.found() error('Lua records require Lua, make sure it is detected on your system') endif -found = opt_lua_records and opt_lua_enabled and dep_lua.found() and dep_libcurl.found() -conf.set('HAVE_LUA_RECORDS', found, description: 'Whether we have Lua records') -summary('Lua Records', found, bool_yn: true, section: 'Configuration') +have_lua_records = opt_lua_records and \ + opt_lua_enabled and \ + dep_lua.found() and \ + dep_libcurl.found() + +dep_lua_records = dependency('', required: false) +if have_lua_records + dep_lua_records = declare_dependency( + dependencies: [ + dep_lua, + dep_libcurl, + ], + ) +endif + +conf.set('HAVE_LUA_RECORDS', have_lua_records, description: 'Lua-based records') +summary('Lua-based Records', have_lua_records, bool_yn: true, section: 'Configuration') -- 2.47.2