util: rust: more rust support for windows/MacOS

Need the same dependencies as Linux.

The RustixError type compiles on Windows.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
This commit is contained in:
Gurchetan Singh
2025-09-26 17:09:36 -07:00
parent a2b42083e4
commit 5eece7596e
2 changed files with 4 additions and 4 deletions

View File

@@ -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<RustixError> for MesaError {
fn from(e: RustixError) -> MesaError {
MesaError::RustixError(e)

View File

@@ -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'],