]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
**/meson.build: avoid deprecations in meson >= 1.4 docs-develop-nits-11ie7m/deployments/4279
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 5 Jun 2024 07:59:30 +0000 (09:59 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 5 Jun 2024 08:01:08 +0000 (10:01 +0200)
The code isn't pretty, but probably better than watching
the fat red lines on every build.

daemon/lua/meson.build
tests/config/meson.build

index 6df5bc5b2fcaf2aa137bd681f88ec0d8fdf9784d..d55d35fc7b33c3b3ecc76ad779bf80dcb66de1f9 100644 (file)
@@ -84,10 +84,15 @@ if get_option('kres_gen_test') and not meson.is_cross_build()
     { 'tname': 'knot_pkt_t', 'incl' : '#include <libknot/packet/pkt.h>', 'dep': libknot },
   ]
   # Construct the lua tester as a meson string.
+  if meson.version().version_compare('>=1.4')
+    kres_gen_lua_path = kres_gen_lua.full_path()
+  else
+    kres_gen_lua_path = '@0@/../../@1@'.format(meson.current_build_dir(), kres_gen_lua)
+  endif
   kres_gen_test_luastr = '''
-    dofile('@0@/../../@1@')
+    dofile('@0@')
     local ffi = require('ffi')
-  '''.format(meson.current_build_dir(), kres_gen_lua)
+  '''.format(kres_gen_lua_path)
   foreach ttc: types_to_check
     # We're careful with adding just includes; otherwise it's more fragile (e.g. linking flags).
     if 'dep' in ttc
index dc345a885b204f7aa98fc35ae70e6b7d9b0481c3..2a9e2487c9eed8081e6841349c72393e9b57a393 100644 (file)
@@ -22,8 +22,11 @@ foreach config_test : config_tests
   conftest_env.prepend('PATH', sbin_dir)
   conftest_env.set('KRESD_NO_LISTEN', '1')
   conftest_env.set('SOURCE_PATH', meson.current_source_dir())
-  conftest_env.set(
-    'TEST_FILE', '@0@/@1@'.format(meson.source_root(), config_test[1][0]))
+  if meson.version().version_compare('>=1.4')
+    conftest_env.set('TEST_FILE', '@0@'.format(config_test[1][0].full_path()))
+  else
+    conftest_env.set('TEST_FILE', '@0@/@1@'.format(meson.source_root(), config_test[1][0]))
+  endif
 
   test(
     'config.' + config_test[0],