From 9d6774ba8f2a5c6097284f2fa325033bcf303a34 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Wed, 18 Mar 2026 16:02:02 +0100 Subject: [PATCH] meson: move mako lib check inside python check This avoids picking a version of python that doesn't have mako installed. Part-of: --- meson.build | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 91f76f6cca9..fa72987c37d 100644 --- a/meson.build +++ b/meson.build @@ -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.')