Ely Office: six offline-first desktop apps in Rust and GPUI
ElyDoc, ElyTable, ElyShow (LibreOfficeKit), ElyPDF (MuPDF), ElyTree (Git), ElyMark (Milkdown and CodeMirror in CEF). ElyMail and ElyAgent follow.
This commit is contained in:
817 files changed
+143101
No files matched your search
@@ -0,0 +1,25 @@
|
||||
use anyhow::Result;
|
||||
|
||||
/// Fails when no graphics device exists; probed on macOS only.
|
||||
pub fn check() -> Result<()> {
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
let devices = metal::Device::all();
|
||||
anyhow::ensure!(
|
||||
!devices.is_empty() || metal::Device::system_default().is_some(),
|
||||
"no Metal graphics device was found"
|
||||
);
|
||||
log::info!("graphics: {} Metal device(s)", devices.len());
|
||||
}
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
log::info!("graphics: the backend is not probed on this OS");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(all(test, target_os = "macos"))]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn this_mac_has_a_metal_device() {
|
||||
super::check().unwrap();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user