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:
16
meson.build
16
meson.build
@@ -841,13 +841,21 @@ if with_gallium_rusticl
|
|||||||
if not with_gallium
|
if not with_gallium
|
||||||
error('rusticl requires at least one gallium driver.')
|
error('rusticl requires at least one gallium driver.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if meson.version().version_compare('< 1.4.0')
|
|
||||||
error('rusticl requires meson 1.4.0 or newer')
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv')
|
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)
|
add_languages('rust', required: true)
|
||||||
rustc = meson.get_compiler('rust')
|
rustc = meson.get_compiler('rust')
|
||||||
rust = import('rust')
|
rust = import('rust')
|
||||||
|
@@ -91,10 +91,6 @@ disasm = executable(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if with_tools.contains('etnaviv')
|
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(
|
isa_bindings_rs = rust.bindgen(
|
||||||
input : 'bindings.h',
|
input : 'bindings.h',
|
||||||
output : 'isa_bindings.rs',
|
output : 'isa_bindings.rs',
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
# Copyright © 2022 Collabora, Ltd.
|
# Copyright © 2022 Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: MIT
|
# 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 = [
|
nak_rust_args = [
|
||||||
'-Aclippy::identity_op',
|
'-Aclippy::identity_op',
|
||||||
'-Aclippy::len_zero',
|
'-Aclippy::len_zero',
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
# Copyright © 2022 Collabora Ltd
|
# Copyright © 2022 Collabora Ltd
|
||||||
# SPDX-License-Identifier: MIT
|
# 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(
|
prog_cbindgen = find_program(
|
||||||
'cbindgen',
|
'cbindgen',
|
||||||
required : true,
|
required : true,
|
||||||
|
Reference in New Issue
Block a user