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 <Hi-Angel@yandex.ru>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17974>
This commit is contained in:
Konstantin Kharlamov 2022-08-10 02:04:51 +03:00 committed by Marge Bot
parent ef611696a5
commit 91362340f3
9 changed files with 11 additions and 19 deletions

View File

@ -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')

View File

@ -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,

View File

@ -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,

View File

@ -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,
)

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,