diff --git a/src/util/rust/error.rs b/src/util/rust/error.rs index 16725dcf6b7..c2111e071b0 100644 --- a/src/util/rust/error.rs +++ b/src/util/rust/error.rs @@ -7,7 +7,6 @@ use std::num::TryFromIntError; use std::str::Utf8Error; use remain::sorted; -#[cfg(any(target_os = "android", target_os = "linux"))] use rustix::io::Errno as RustixError; use thiserror::Error; @@ -25,7 +24,6 @@ pub enum MesaError { #[error("Nul Error occurred {0}")] NulError(NulError), /// Rustix crate error. - #[cfg(any(target_os = "android", target_os = "linux"))] #[error("The errno is {0}")] RustixError(RustixError), /// An attempted integer conversion failed. @@ -42,7 +40,6 @@ pub enum MesaError { WithContext(&'static str), } -#[cfg(any(target_os = "android", target_os = "linux"))] impl From for MesaError { fn from(e: RustixError) -> MesaError { MesaError::RustixError(e) diff --git a/src/util/rust/meson.build b/src/util/rust/meson.build index 8e95ed235d1..e8cb269c142 100644 --- a/src/util/rust/meson.build +++ b/src/util/rust/meson.build @@ -34,7 +34,10 @@ dep_zerocopy_derive = dependency('zerocopy-derive', dep_mesa3d_util = [dep_cfg_if, dep_thiserror, dep_remain, dep_zerocopy, dep_zerocopy_derive] -if host_machine.system() == 'linux' +supported_systems = ['linux', 'windows', 'darwin', 'macos'] +supported_host_machine = host_machine.system() in supported_systems + +if supported_host_machine dep_rustix = dependency('rustix', version: '>= 0.38.31', fallback: ['rustix-1-rs', 'dep_rustix'],