Skip to content

Commit 0e62594

Browse files
committed
Make it possible to build examples with just x11 / just wayland
1 parent 7444a0c commit 0e62594

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ jobs:
101101
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, }
102102
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: --no-default-features, features: "x11,x11-dlopen" }
103103
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: --no-default-features, features: "wayland,wayland-dlopen" }
104-
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: --no-default-features, features: "kms" }
104+
# Build with a dummy Winit backend.
105+
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: --no-default-features, features: "kms,winit/wayland,winit/wayland-dlopen" }
105106
- { target: x86_64-unknown-redox, os: ubuntu-latest, }
106107
- { target: x86_64-unknown-freebsd, os: ubuntu-latest, }
107108
- { target: x86_64-unknown-netbsd, os: ubuntu-latest, options: --no-default-features, features: "x11,x11-dlopen,wayland,wayland-dlopen" }

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,18 @@ wayland = [
2626
"memmap2",
2727
"rustix",
2828
"fastrand",
29+
"winit/wayland",
30+
"winit/wayland-csd-adwaita",
2931
]
30-
wayland-dlopen = ["wayland-sys/dlopen"]
32+
wayland-dlopen = ["wayland-sys/dlopen", "winit/wayland-dlopen"]
3133
x11 = [
3234
"as-raw-xcb-connection",
3335
"bytemuck",
3436
"fastrand",
3537
"rustix",
3638
"tiny-xlib",
3739
"x11rb",
40+
"winit/x11",
3841
]
3942
x11-dlopen = ["tiny-xlib/dlopen", "x11rb/dl-libxcb"]
4043

@@ -133,7 +136,7 @@ redox_syscall = "0.7"
133136
[dev-dependencies]
134137
colorous = "1.0.12"
135138
web-time = "1.0.0"
136-
winit = "0.30.0"
139+
winit = { version = "0.30.0", default-features = false, features = ["rwh_06"] }
137140
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
138141
glam = { version = "0.30.10", features = ["rand"] }
139142
rand = "0.9.2"

0 commit comments

Comments
 (0)