meson: move yaml lib check inside python check

This avoids picking a version of python that doesn't have pyyaml installed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40514>
This commit is contained in:
Eric Engestrom 2026-03-18 16:02:43 +01:00 committed by Marge Bot
parent 9d6774ba8f
commit dbbc7800c5

View file

@ -1070,6 +1070,11 @@ if Version(mako.__version__) < Version("0.8.0"):
continue
endif
has_yaml = run_command(prog_python, '-c', 'import yaml', check: false)
if has_yaml.returncode() != 0
continue
endif
break
endforeach
@ -1083,11 +1088,6 @@ elif has_mako.returncode() == 2
error('One of Python (3.x) packaging or distutils module is required.')
endif
has_yaml = run_command(
prog_python, '-c',
'''
import yaml
''', check: false)
if has_yaml.returncode() != 0
error('Python (3.x) yaml module (PyYAML) required to build mesa.')
endif