@@ -9,9 +9,9 @@ extern crate core;
9
9
mod win32;
10
10
#[ cfg( target_os = "macos" ) ]
11
11
mod cg;
12
- #[ cfg( any( target_os = "linux" , target_os = "freebsd" ) ) ]
12
+ #[ cfg( all ( feature = "x11" , any( target_os = "linux" , target_os = "freebsd" ) ) ) ]
13
13
mod x11;
14
- #[ cfg( any( target_os = "linux" , target_os = "freebsd" ) ) ]
14
+ #[ cfg( all ( feature = "wayland" , any( target_os = "linux" , target_os = "freebsd" ) ) ) ]
15
15
mod wayland;
16
16
#[ cfg( target_arch = "wasm32" ) ]
17
17
mod web;
@@ -49,9 +49,9 @@ impl GraphicsContext {
49
49
/// lifetime of the GraphicsContext
50
50
pub unsafe fn from_raw ( raw_window_handle : RawWindowHandle , raw_display_handle : RawDisplayHandle ) -> Result < Self , SwBufError > {
51
51
let imple: Box < dyn GraphicsContextImpl > = match ( raw_window_handle, raw_display_handle) {
52
- #[ cfg( any( target_os = "linux" , target_os = "freebsd" ) ) ]
52
+ #[ cfg( all ( feature = "x11" , any( target_os = "linux" , target_os = "freebsd" ) ) ) ]
53
53
( RawWindowHandle :: Xlib ( xlib_window_handle) , RawDisplayHandle :: Xlib ( xlib_display_handle) ) => Box :: new ( x11:: X11Impl :: new ( xlib_window_handle, xlib_display_handle) ?) ,
54
- #[ cfg( any( target_os = "linux" , target_os = "freebsd" ) ) ]
54
+ #[ cfg( all ( feature = "wayland" , any( target_os = "linux" , target_os = "freebsd" ) ) ) ]
55
55
( RawWindowHandle :: Wayland ( wayland_window_handle) , RawDisplayHandle :: Wayland ( wayland_display_handle) ) => Box :: new ( wayland:: WaylandImpl :: new ( wayland_window_handle, wayland_display_handle) ?) ,
56
56
#[ cfg( target_os = "windows" ) ]
57
57
( RawWindowHandle :: Win32 ( win32_handle) , _) => Box :: new ( win32:: Win32Impl :: new ( & win32_handle) ?) ,
0 commit comments