Enable Wayland and x11 code on FreeBSD

This commit is contained in:
Ian Douglas Scott 2022-12-19 16:29:16 -08:00 committed by Jeremy Soller
parent 3dc11f75c1
commit 33fe3ae3c7
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
2 changed files with 5 additions and 5 deletions

View file

@ -15,7 +15,7 @@ exclude = ["examples"]
thiserror = "1.0.30"
raw-window-handle = "0.5.0"
[target.'cfg(target_os = "linux")'.dependencies]
[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
nix = "0.26.1"
wayland-backend = {version = "0.1.0-beta.14", features = ["client_system"]}
wayland-client = {version = "0.30.0-beta.14"}

View file

@ -9,9 +9,9 @@ extern crate core;
mod win32;
#[cfg(target_os = "macos")]
mod cg;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
mod x11;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
mod wayland;
#[cfg(target_arch = "wasm32")]
mod web;
@ -44,9 +44,9 @@ impl<W: HasRawWindowHandle + HasRawDisplayHandle> GraphicsContext<W> {
let raw_display_handle = window.raw_display_handle();
let imple: Box<dyn GraphicsContextImpl> = match (raw_window_handle, raw_display_handle) {
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
(RawWindowHandle::Xlib(xlib_window_handle), RawDisplayHandle::Xlib(xlib_display_handle)) => Box::new(x11::X11Impl::new(xlib_window_handle, xlib_display_handle)?),
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
(RawWindowHandle::Wayland(wayland_window_handle), RawDisplayHandle::Wayland(wayland_display_handle)) => Box::new(wayland::WaylandImpl::new(wayland_window_handle, wayland_display_handle)?),
#[cfg(target_os = "windows")]
(RawWindowHandle::Win32(win32_handle), _) => Box::new(win32::Win32Impl::new(&win32_handle)?),