Module: Mesa
Branch: main
Commit: 91362340f33eabf95d64c6116a813d7c88ff802f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=91362340f33eabf95d64c6116a813d7c88ff802f

Author: Konstantin Kharlamov <[email protected]>
Date:   Wed Aug 10 02:04:51 2022 +0300

meson: remove source_root() call in nir compiler path

source_root function is deprecated in Meson version 0.56.0, so let's use
instead a current_source_dir() function, available in all Meson
versions. This also allows to deduplicate some code by declaring
commonly used string at the top meson.build file.

Signed-off-by: Konstantin Kharlamov <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17974>

---

 meson.build                          | 2 ++
 src/freedreno/ir3/meson.build        | 6 ++----
 src/gallium/drivers/lima/meson.build | 3 +--
 src/gallium/drivers/r300/meson.build | 4 +---
 src/gallium/drivers/zink/meson.build | 3 +--
 src/intel/compiler/meson.build       | 3 +--
 src/microsoft/compiler/meson.build   | 3 +--
 src/panfrost/bifrost/meson.build     | 3 +--
 src/panfrost/midgard/meson.build     | 3 +--
 9 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/meson.build b/meson.build
index 048020e3779..b221a58610a 100644
--- a/meson.build
+++ b/meson.build
@@ -2251,6 +2251,8 @@ gcc_lto_quirk = (cc.get_id() == 'gcc') ? ['-fno-lto'] : []
 
 devenv = environment()
 
+dir_compiler_nir = join_paths(meson.current_source_dir(), 'src/compiler/nir/')
+
 subdir('include')
 subdir('bin')
 subdir('src')
diff --git a/src/freedreno/ir3/meson.build b/src/freedreno/ir3/meson.build
index 0f6e1900a5e..ad9a0c1a76a 100644
--- a/src/freedreno/ir3/meson.build
+++ b/src/freedreno/ir3/meson.build
@@ -23,8 +23,7 @@ ir3_nir_trig_c = custom_target(
   input : 'ir3_nir_trig.py',
   output : 'ir3_nir_trig.c',
   command : [
-    prog_python, '@INPUT@',
-    '-p', join_paths(meson.source_root(), 'src/compiler/nir/'),
+    prog_python, '@INPUT@', '-p', dir_compiler_nir,
   ],
   capture : true,
   depend_files : nir_algebraic_depends,
@@ -35,8 +34,7 @@ ir3_nir_imul_c = custom_target(
   input : 'ir3_nir_imul.py',
   output : 'ir3_nir_imul.c',
   command : [
-    prog_python, '@INPUT@',
-    '-p', join_paths(meson.source_root(), 'src/compiler/nir/'),
+    prog_python, '@INPUT@', '-p', dir_compiler_nir,
   ],
   capture : true,
   depend_files : nir_algebraic_depends,
diff --git a/src/gallium/drivers/lima/meson.build 
b/src/gallium/drivers/lima/meson.build
index 5d8f21c2cf8..32e9c8ed360 100644
--- a/src/gallium/drivers/lima/meson.build
+++ b/src/gallium/drivers/lima/meson.build
@@ -91,8 +91,7 @@ lima_nir_algebraic_c = custom_target(
   input : 'ir/lima_nir_algebraic.py',
   output : 'lima_nir_algebraic.c',
   command : [
-    prog_python, '@INPUT@',
-    '-p', join_paths(meson.source_root(), 'src/compiler/nir/'),
+    prog_python, '@INPUT@', '-p', dir_compiler_nir,
   ],
   capture : true,
   depend_files : nir_algebraic_depends,
diff --git a/src/gallium/drivers/r300/meson.build 
b/src/gallium/drivers/r300/meson.build
index f3423a17ff5..685f4a761c7 100644
--- a/src/gallium/drivers/r300/meson.build
+++ b/src/gallium/drivers/r300/meson.build
@@ -121,9 +121,7 @@ r300_nir_algebraic_c = custom_target(
   input : 'compiler/r300_nir_algebraic.py',
   output : 'r300_nir_algebraic.c',
   command : [
-    prog_python, '@INPUT@',
-    '-p', join_paths(meson.source_root(), 'src/compiler/nir/'),
-    '@OUTPUT@',
+    prog_python, '@INPUT@', '-p', dir_compiler_nir, '@OUTPUT@',
   ],
   depend_files : nir_algebraic_depends,
 )
diff --git a/src/gallium/drivers/zink/meson.build 
b/src/gallium/drivers/zink/meson.build
index 4621e7f983e..a85e30bcb14 100644
--- a/src/gallium/drivers/zink/meson.build
+++ b/src/gallium/drivers/zink/meson.build
@@ -68,8 +68,7 @@ zink_nir_algebraic_c = custom_target(
   input : 'nir_to_spirv/zink_nir_algebraic.py',
   output : 'zink_nir_algebraic.c',
   command : [
-    prog_python, '@INPUT@',
-    '-p', join_paths(meson.source_root(), 'src/compiler/nir/'),
+    prog_python, '@INPUT@', '-p', dir_compiler_nir,
   ],
   capture : true,
   depend_files : nir_algebraic_depends,
diff --git a/src/intel/compiler/meson.build b/src/intel/compiler/meson.build
index 435524acd0f..5fc53b82c73 100644
--- a/src/intel/compiler/meson.build
+++ b/src/intel/compiler/meson.build
@@ -149,8 +149,7 @@ brw_nir_trig = custom_target(
   input : 'brw_nir_trig_workarounds.py',
   output : 'brw_nir_trig_workarounds.c',
   command : [
-    prog_python, '@INPUT@',
-    '-p', join_paths(meson.source_root(), 'src/compiler/nir/'),
+    prog_python, '@INPUT@', '-p', dir_compiler_nir,
   ],
   depend_files : nir_algebraic_depends,
   capture : true,
diff --git a/src/microsoft/compiler/meson.build 
b/src/microsoft/compiler/meson.build
index 391ac83e936..c37a16b3a38 100644
--- a/src/microsoft/compiler/meson.build
+++ b/src/microsoft/compiler/meson.build
@@ -44,8 +44,7 @@ dxil_nir_algebraic_c = custom_target(
   input : 'dxil_nir_algebraic.py',
   output : 'dxil_nir_algebraic.c',
   command : [
-    prog_python, '@INPUT@',
-    '-p', join_paths(meson.source_root(), 'src/compiler/nir/'),
+    prog_python, '@INPUT@', '-p', dir_compiler_nir,
   ],
   capture : true,
   depend_files : nir_algebraic_depends,
diff --git a/src/panfrost/bifrost/meson.build b/src/panfrost/bifrost/meson.build
index 161dd4b40b0..f316c1ba3ac 100644
--- a/src/panfrost/bifrost/meson.build
+++ b/src/panfrost/bifrost/meson.build
@@ -128,8 +128,7 @@ bifrost_nir_algebraic_c = custom_target(
   input : 'bifrost_nir_algebraic.py',
   output : 'bifrost_nir_algebraic.c',
   command : [
-    prog_python, '@INPUT@',
-    '-p', join_paths(meson.source_root(), 'src/compiler/nir/'),
+    prog_python, '@INPUT@', '-p', dir_compiler_nir,
   ],
   capture : true,
   depend_files : nir_algebraic_depends,
diff --git a/src/panfrost/midgard/meson.build b/src/panfrost/midgard/meson.build
index 64c584cb7b1..cadf55f00d6 100644
--- a/src/panfrost/midgard/meson.build
+++ b/src/panfrost/midgard/meson.build
@@ -48,8 +48,7 @@ midgard_nir_algebraic_c = custom_target(
   input : 'midgard_nir_algebraic.py',
   output : 'midgard_nir_algebraic.c',
   command : [
-    prog_python, '@INPUT@',
-    '-p', join_paths(meson.source_root(), 'src/compiler/nir/'),
+    prog_python, '@INPUT@', '-p', dir_compiler_nir,
   ],
   capture : true,
   depend_files : nir_algebraic_depends,

Reply via email to