rusticl: Show an error message if the build is attempted with an outdated bindgen version

Ideally the build system would fetch the correct bindgen version automatically like cargo does.
Until then, provide an error message that is hopefully more helpful than whatever cryptic error the
build runs into otherwise.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9457
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10029
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25859>
This commit is contained in:
LingMan
2023-10-24 05:47:06 +02:00
committed by Marge Bot
parent e350193eb5
commit 1cc26e8b66

View File

@@ -114,6 +114,10 @@ rusticl_bindgen_args = [
'--anon-fields-prefix', 'anon_',
]
if find_program('bindgen').version().version_compare('< 0.62')
error('rusticl requires bindgen 0.62 or newer. If your distribution does not ship a recent enough version, you can install the latest version for your user with `cargo install bindgen-cli`.')
endif
if find_program('bindgen').version().version_compare('< 0.65')
rusticl_bindgen_args += [
'--size_t-is-usize',