Skip to content

Commit 33fe3ae

Browse files
ids1024jackpot51
authored andcommitted
Enable Wayland and x11 code on FreeBSD
1 parent 3dc11f7 commit 33fe3ae

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exclude = ["examples"]
1515
thiserror = "1.0.30"
1616
raw-window-handle = "0.5.0"
1717

18-
[target.'cfg(target_os = "linux")'.dependencies]
18+
[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
1919
nix = "0.26.1"
2020
wayland-backend = {version = "0.1.0-beta.14", features = ["client_system"]}
2121
wayland-client = {version = "0.30.0-beta.14"}

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ extern crate core;
99
mod win32;
1010
#[cfg(target_os = "macos")]
1111
mod cg;
12-
#[cfg(target_os = "linux")]
12+
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
1313
mod x11;
14-
#[cfg(target_os = "linux")]
14+
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
1515
mod wayland;
1616
#[cfg(target_arch = "wasm32")]
1717
mod web;
@@ -44,9 +44,9 @@ impl<W: HasRawWindowHandle + HasRawDisplayHandle> GraphicsContext<W> {
4444
let raw_display_handle = window.raw_display_handle();
4545

4646
let imple: Box<dyn GraphicsContextImpl> = match (raw_window_handle, raw_display_handle) {
47-
#[cfg(target_os = "linux")]
47+
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
4848
(RawWindowHandle::Xlib(xlib_window_handle), RawDisplayHandle::Xlib(xlib_display_handle)) => Box::new(x11::X11Impl::new(xlib_window_handle, xlib_display_handle)?),
49-
#[cfg(target_os = "linux")]
49+
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
5050
(RawWindowHandle::Wayland(wayland_window_handle), RawDisplayHandle::Wayland(wayland_display_handle)) => Box::new(wayland::WaylandImpl::new(wayland_window_handle, wayland_display_handle)?),
5151
#[cfg(target_os = "windows")]
5252
(RawWindowHandle::Win32(win32_handle), _) => Box::new(win32::Win32Impl::new(&win32_handle)?),

0 commit comments

Comments
 (0)