[igt-dev] [PATCH i-g-t v4 4/8] meson: get rid of a future-deprecated warning

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Wed Mar 22 08:28:22 UTC 2023


From: Mauro Carvalho Chehab <mchehab at kernel.org>

A warning is generated with newer meson versions:

	NOTICE: Future-deprecated features used:
	 * 0.56.0: {'meson.source_root'}

While there is a new macro to get it, that would rise the
dependency chain to meson 0.56. So, instead, just store it
on a variable.

Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
---
 lib/meson.build | 2 +-
 meson.build     | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/meson.build b/lib/meson.build
index 768ce90b54df..ad9e2abef4c3 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -178,7 +178,7 @@ endif
 if get_option('srcdir') != ''
     srcdir = join_paths(get_option('srcdir'), 'tests')
 else
-    srcdir = join_paths(meson.source_root(), 'tests')
+    srcdir = join_paths(source_root, 'tests')
 endif
 
 if get_option('version_hash') != ''
diff --git a/meson.build b/meson.build
index b896283e3244..12d5113a9042 100644
--- a/meson.build
+++ b/meson.build
@@ -13,6 +13,9 @@ if get_option('b_ndebug') != 'false'
 	error('Building without -Db_ndebug=false is not supported')
 endif
 
+# meson.source_root is marked as a future-deprecated feature
+source_root = meson.current_source_dir()
+
 cc = meson.get_compiler('c')
 
 # Also make sure that the user doesn't have -DNDEBUG defined in their config
-- 
2.39.2



More information about the igt-dev mailing list