diff options
author | Danylo Piliaiev <dpiliaiev@igalia.com> | 2022-11-01 17:42:08 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-11-22 06:11:07 +0000 |
commit | 703d85485f85e8336787d4169525af977b55a82f (patch) | |
tree | 8de51dd530c2fc46e0945ea00267bdbcce505612 /meson.build | |
parent | 74ad255c8c6beddff6a47bab81e297f888c95ef4 (diff) | |
download | mesa-703d85485f85e8336787d4169525af977b55a82f.tar.gz |
meson: do not use source_root() when possible
source_root() function is deprecated in Meson version 0.56.0 because
it returns the source root of the parent project if called from a
subproject.
Why would anyone need Mesa as a meson subproject?
It would be used as subproject in a project generated by command buffer
"decompiler" for Freedreno.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19901>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 1aebd04e5d7..90a92e5e517 100644 --- a/meson.build +++ b/meson.build @@ -22,7 +22,8 @@ project( 'mesa', ['c', 'cpp'], version : run_command( - [find_program('python3', 'python'), 'bin/meson_get_version.py'], + [find_program('python3', 'python'), 'bin/meson_get_version.py', + meson.version().version_compare('>= 0.56') ? meson.project_source_root() : meson.source_root()], check : true ).stdout(), license : 'MIT', @@ -2289,6 +2290,14 @@ gcc_lto_quirk = (cc.get_id() == 'gcc') ? ['-fno-lto'] : [] devenv = environment() dir_compiler_nir = join_paths(meson.current_source_dir(), 'src/compiler/nir/') +if meson.version().version_compare('>= 0.56') + dir_source_root = meson.project_source_root() +else + # source_root() returns a source root of the parent project if called from + # a subproject, which makes impossible to use Mesa as a meson subproject. + dir_source_root = meson.source_root() +endif + subdir('include') subdir('bin') |