meson: centralize checking for new enough meson for rust support

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30414>
This commit is contained in:
Karol Herbst 2024-07-30 12:10:20 +02:00 committed by Marge Bot
parent b3a9c91d9b
commit f7f343796f
4 changed files with 12 additions and 16 deletions

View File

@ -841,13 +841,21 @@ if with_gallium_rusticl
if not with_gallium
error('rusticl requires at least one gallium driver.')
endif
if meson.version().version_compare('< 1.4.0')
error('rusticl requires meson 1.4.0 or newer')
endif
endif
if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv')
if with_gallium_rusticl
# uses rust.bindgen.output_inline_wrapper needing 1.4.0
if meson.version().version_compare('< 1.4.0')
error('Rusticl requires meson 1.4.0 or newer')
endif
else
# see https://github.com/mesonbuild/meson/issues/12758 (backported to 1.3.2)
if meson.version().version_compare('< 1.3.2')
error('Mesa Rust support requires meson 1.3.2 or newer')
endif
endif
add_languages('rust', required: true)
rustc = meson.get_compiler('rust')
rust = import('rust')

View File

@ -91,10 +91,6 @@ disasm = executable(
)
if with_tools.contains('etnaviv')
if meson.version().version_compare('< 1.4.0')
error('etnaviv requires meson 1.4.0 or newer')
endif
isa_bindings_rs = rust.bindgen(
input : 'bindings.h',
output : 'isa_bindings.rs',

View File

@ -1,9 +1,5 @@
# Copyright © 2022 Collabora, Ltd.
# SPDX-License-Identifier: MIT
if meson.version().version_compare('< 1.3.0')
error('NVK requires meson 1.3.0 or newer')
endif
nak_rust_args = [
'-Aclippy::identity_op',
'-Aclippy::len_zero',

View File

@ -1,9 +1,5 @@
# Copyright © 2022 Collabora Ltd
# SPDX-License-Identifier: MIT
if meson.version().version_compare('< 1.3.0')
error('NVK requires meson 1.3.0 or newer')
endif
prog_cbindgen = find_program(
'cbindgen',
required : true,