diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-06-05 09:59:30 +0200 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-06-05 10:01:08 +0200 |
commit | e805b98460879d8d5a88267aa302e44db04e0dfd (patch) | |
tree | b73acf0919882ee5ea99b14f477e3f4eed659d61 | |
parent | meson.build: avoid a gcc 14 warning (diff) | |
download | knot-resolver-e805b98460879d8d5a88267aa302e44db04e0dfd.tar.xz knot-resolver-e805b98460879d8d5a88267aa302e44db04e0dfd.zip |
**/meson.build: avoid deprecations in meson >= 1.4
The code isn't pretty, but probably better than watching
the fat red lines on every build.
-rw-r--r-- | daemon/lua/meson.build | 9 | ||||
-rw-r--r-- | tests/config/meson.build | 7 |
2 files changed, 12 insertions, 4 deletions
diff --git a/daemon/lua/meson.build b/daemon/lua/meson.build index 6df5bc5b..d55d35fc 100644 --- a/daemon/lua/meson.build +++ b/daemon/lua/meson.build @@ -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 diff --git a/tests/config/meson.build b/tests/config/meson.build index dc345a88..2a9e2487 100644 --- a/tests/config/meson.build +++ b/tests/config/meson.build @@ -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], |