meson: error when missing hawkmoth

Hawkmoth is a hard depedency, and building without it will lead to
errors. Give a friendly error early on.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11494>
This commit is contained in:
Erik Faye-Lund
2023-10-31 05:57:26 +01:00
committed by Marge Bot
parent 2063003457
commit e31dde13d1

View File

@@ -1,3 +1,16 @@
get_option('html-docs').require(
run_command(prog_python, '-c',
'''
try:
from packaging.version import Version
except:
from distutils.version import StrictVersion as Version
import hawkmoth
assert Version(hawkmoth.__version__) >= Version("0.16.0")
''', check: false).returncode() == 0,
error_message: 'hawkmoth >= 0.16.0 required'
)
html_docs = custom_target(
'html',
depfile: 'docs.d',