]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Cleanup lua-records module
authorFred Morcos <fred.morcos@open-xchange.com>
Tue, 15 Aug 2023 21:40:01 +0000 (23:40 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:38 +0000 (13:28 +0100)
meson.build
meson/lua-records/meson.build

index f8b6b8b4ef765d7fce7e0e46db130183dfc66a8b..5e5fe82641cb854c4bb4f94796fec9e87ca6aaee 100644 (file)
@@ -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
index 7b91ae71ed000c0317ff5d9eb357064899652354..a13cea6505d93d023dc0a37156277789c1f893c3 100644 (file)
@@ -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')