diff --git a/meson.build b/meson.build index 99637745dfd..1d66214659f 100644 --- a/meson.build +++ b/meson.build @@ -845,12 +845,15 @@ if with_gallium_rusticl 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') add_languages('rust', required: true) rustc = meson.get_compiler('rust') + rust = import('rust') if rustc.version().version_compare('< 1.76') - error('rusticl requires Rust 1.76.0 or newer') + error('Mesa requires Rust 1.76.0 or newer') endif endif diff --git a/src/etnaviv/isa/meson.build b/src/etnaviv/isa/meson.build index f087a259fe7..86bb62ea4eb 100644 --- a/src/etnaviv/isa/meson.build +++ b/src/etnaviv/isa/meson.build @@ -95,9 +95,6 @@ if with_tools.contains('etnaviv') error('etnaviv requires meson 1.4.0 or newer') endif - add_languages('rust', required: true) - rust = import('rust') - isa_bindings_rs = rust.bindgen( input : 'bindings.h', output : 'isa_bindings.rs', diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build index 9cf603c6a6d..004d453c283 100644 --- a/src/gallium/frontends/rusticl/meson.build +++ b/src/gallium/frontends/rusticl/meson.build @@ -2,7 +2,6 @@ # SPDX-License-Identifier: MIT fs = import('fs') -rust = import('rust') libmesa_rust_util_files = files( 'util/lib.rs', diff --git a/src/nouveau/compiler/meson.build b/src/nouveau/compiler/meson.build index 01f1637bc07..8819b267222 100644 --- a/src/nouveau/compiler/meson.build +++ b/src/nouveau/compiler/meson.build @@ -4,14 +4,6 @@ if meson.version().version_compare('< 1.3.0') error('NVK requires meson 1.3.0 or newer') endif -add_languages('rust', required: true) -rust = import('rust') - -rc = meson.get_compiler('rust') -if rc.version().version_compare('< 1.73.0') - error('NAK requires Rust 1.73.0') -endif - bindgen_version = find_program('bindgen').version() if bindgen_version == 'unknown' diff --git a/src/nouveau/headers/meson.build b/src/nouveau/headers/meson.build index 759e8831a21..da2015d236b 100644 --- a/src/nouveau/headers/meson.build +++ b/src/nouveau/headers/meson.build @@ -70,9 +70,6 @@ executable( # Only generate Rust bindings for NVK if with_nouveau_vk - add_languages('rust', required: true) - rust = import('rust') - cl_rs_generated = [] foreach cl : nv_classes cl_rs_generated += custom_target( diff --git a/src/nouveau/nil/meson.build b/src/nouveau/nil/meson.build index 94bc6c21e61..72b2fcfe3a1 100644 --- a/src/nouveau/nil/meson.build +++ b/src/nouveau/nil/meson.build @@ -4,14 +4,6 @@ if meson.version().version_compare('< 1.3.0') error('NVK requires meson 1.3.0 or newer') endif -add_languages('rust', required: true) -rust = import('rust') - -rc = meson.get_compiler('rust') -if rc.version().version_compare('< 1.73.0') - error('nil_rs requires Rust 1.73.0') -endif - prog_cbindgen = find_program( 'cbindgen', required : true,