meson: move mako lib check inside python check

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

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

View file

@ -1045,16 +1045,9 @@ foreach p : python_exec_list
continue
endif
break
endforeach
if not prog_python.found()
error('Python ' + python_version_req + ' not found')
endif
has_mako = run_command(
prog_python, '-c',
'''
has_mako = run_command(
prog_python, '-c',
'''
import sys
try:
@ -1073,6 +1066,16 @@ except:
if Version(mako.__version__) < Version("0.8.0"):
sys.exit(1)
''', check: false)
if has_mako.returncode() != 0
continue
endif
break
endforeach
if not prog_python.found()
error('Python ' + python_version_req + ' not found')
endif
if has_mako.returncode() == 1
error('Python (3.x) mako module >= 0.8.0 required to build mesa.')