From b1d9180ccaf355481eec78c61af6c725d4e81417 Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Mon, 1 Jul 2024 12:13:27 +0200 Subject: [PATCH] correct conditional compilation --- src/capture.rs | 4 +--- src/emulate.rs | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/capture.rs b/src/capture.rs index ca93091..1d9bc08 100644 --- a/src/capture.rs +++ b/src/capture.rs @@ -37,9 +37,7 @@ pub async fn create( if let Some(backend) = backend { return match backend { #[cfg(all(unix, feature = "libei", not(target_os = "macos")))] - CaptureBackend::InputCapturePortal => { - Ok(Box::new(libei::LibeiInputCapture::new().await?)) - } + CaptureBackend::InputCapturePortal => Ok(Box::new(libei::LibeiInputCapture::new().await?)), #[cfg(all(unix, feature = "wayland", not(target_os = "macos")))] CaptureBackend::LayerShell => Ok(Box::new(wayland::WaylandInputCapture::new()?)), #[cfg(all(unix, feature = "x11", not(target_os = "macos")))] diff --git a/src/emulate.rs b/src/emulate.rs index 7dd4e66..e37cccb 100644 --- a/src/emulate.rs +++ b/src/emulate.rs @@ -50,8 +50,15 @@ pub async fn create( ) -> Result, EmulationCreationError> { if let Some(backend) = backend { return match backend { + #[cfg(windows)] + EmulationBackend::Windows => Ok(Box::new(windows::WindowsEmulation::new()?)), + #[cfg(target_os = "macos")] + EmulationBackend::MacOs => Ok(Box::new(windows::MacOSEmulation::new()?)), + #[cfg(all(unix, feature = "libei", not(target_os = "macos")))] EmulationBackend::Libei => Ok(Box::new(libei::LibeiEmulation::new().await?)), + #[cfg(all(unix, feature = "wayland", not(target_os = "macos")))] EmulationBackend::Wlroots => Ok(Box::new(wlroots::WlrootsEmulation::new()?)), + #[cfg(all(unix, feature = "x11", not(target_os = "macos")))] EmulationBackend::X11 => Ok(Box::new(x11::X11Emulation::new()?)), EmulationBackend::Dummy => Ok(Box::new(dummy::DummyEmulation::new())), };