From: Vladimír Čunát Date: Wed, 5 Jun 2024 07:59:30 +0000 (+0200) Subject: **/meson.build: avoid deprecations in meson >= 1.4 X-Git-Tag: v5.7.4~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e805b98460879d8d5a88267aa302e44db04e0dfd;p=thirdparty%2Fknot-resolver.git **/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. --- diff --git a/daemon/lua/meson.build b/daemon/lua/meson.build index 6df5bc5b2..d55d35fc7 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 ', '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 dc345a885..2a9e2487c 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],