-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathCargo.toml
More file actions
210 lines (188 loc) · 5.73 KB
/
Cargo.toml
File metadata and controls
210 lines (188 loc) · 5.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
[workspace]
members = ["run-wasm"]
[package]
name = "softbuffer"
version = "0.4.8"
edition = "2021"
description = "Cross-platform buffer for software rendering"
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/softbuffer"
repository = "https://github.com/rust-windowing/softbuffer"
rust-version = "1.71.0"
keywords = ["framebuffer", "windowing"]
categories = ["game-development", "graphics", "gui", "multimedia", "rendering"]
exclude = ["examples"]
[features]
default = ["wayland", "wayland-dlopen", "x11", "x11-dlopen"]
# Enable the Wayland backend.
wayland = [
"dep:wayland-backend",
"dep:wayland-client",
"dep:wayland-sys",
"dep:memmap2",
"dep:rustix",
"dep:fastrand",
# Only used as a dev-dependency.
"winit/wayland",
"winit/wayland-csd-adwaita",
]
wayland-dlopen = ["wayland-sys/dlopen", "winit/wayland-dlopen"]
# Enable the X11 backend.
x11 = [
"dep:as-raw-xcb-connection",
"dep:fastrand",
"dep:rustix",
"dep:tiny-xlib",
"dep:x11rb",
# Only used as a dev-dependency.
"winit/x11",
]
x11-dlopen = ["tiny-xlib/dlopen", "x11rb/dl-libxcb"]
# Enable the KMS/DRM backend.
kms = ["dep:drm", "dep:rustix"]
# Common dependencies.
[dependencies]
raw-window-handle = { version = "0.6", features = ["std"] }
tracing = { version = "0.1.41", default-features = false }
# Android dependencies.
[target.'cfg(target_os = "android")'.dependencies]
ndk = "0.9.0"
# Wayland, X11 and KMS/DRM dependencies.
[target.'cfg(not(any(target_os = "android", target_vendor = "apple", target_os = "redox", target_family = "wasm", target_os = "windows")))'.dependencies]
# Common
fastrand = { version = "2.0.0", optional = true }
rustix = { version = "1.0.1", default-features = false, optional = true, features = [
"fs",
"mm",
"shm",
"std",
] }
# Wayland
memmap2 = { version = "0.9.0", optional = true }
wayland-backend = { version = "0.3.0", optional = true, features = [
"client_system",
] }
wayland-client = { version = "0.31.14", optional = true }
wayland-sys = { version = "0.31.0", optional = true }
# X11
as-raw-xcb-connection = { version = "1.0.0", optional = true }
tiny-xlib = { version = "0.2.1", optional = true }
x11rb = { version = "0.13.0", optional = true, features = [
"allow-unsafe-code",
"shm",
] }
# KMS/DRM
drm = { version = "0.15.0", default-features = false, optional = true }
# Windows dependencies.
[target.'cfg(target_os = "windows")'.dependencies]
windows-sys = { version = "0.61.2", features = [
"Win32_Graphics_Gdi",
"Win32_UI_ColorSystem",
"Win32_UI_Shell",
"Win32_UI_WindowsAndMessaging",
"Win32_Foundation",
] }
# CoreGraphics (macOS/iOS/...) dependencies.
[target.'cfg(target_vendor = "apple")'.dependencies]
objc2 = "0.6.0"
libc = "0.2.180"
objc2-core-graphics = { version = "0.3.2", default-features = false, features = [
"std",
"objc2",
"libc",
"CGColorSpace",
"CGDataProvider",
"CGImage",
] }
objc2-core-foundation = { version = "0.3.2", default-features = false, features = [
"std",
"CFCGTypes",
] }
objc2-foundation = { version = "0.3.2", default-features = false, features = [
"std",
"objc2-core-foundation",
"NSDictionary",
"NSGeometry",
"NSKeyValueObserving",
"NSString",
"NSThread",
"NSValue",
"NSNull",
] }
objc2-quartz-core = { version = "0.3.2", default-features = false, features = [
"std",
"objc2-core-foundation",
"CALayer",
"CATransaction",
] }
# Web dependencies.
[target.'cfg(target_family = "wasm")'.dependencies]
js-sys = "0.3.63"
wasm-bindgen = "0.2.108"
web-sys = { version = "0.3.55", features = [
"CanvasRenderingContext2d",
"Document",
"Element",
"HtmlCanvasElement",
"ImageData",
"OffscreenCanvas",
"OffscreenCanvasRenderingContext2d",
"Window",
] }
# Orbital dependencies.
[target.'cfg(target_os = "redox")'.dependencies]
redox_syscall = "0.7"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
default-target = "x86_64-unknown-linux-gnu"
targets = [
"x86_64-pc-windows-msvc",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"wasm32-unknown-unknown",
]
##
## Development-related stuff below.
##
[[example]]
# Run with `cargo apk run --example winit_android`
name = "winit_android"
crate-type = ["cdylib"]
[[example]]
# Run with `cargo apk run --example winit_multithread_android`
name = "winit_multithread_android"
crate-type = ["cdylib"]
[[bench]]
name = "buffer"
harness = false
[dev-dependencies]
colorous = "1.0.12"
web-time = "1.0.0"
winit = { version = "0.30.0", default-features = false, features = ["rwh_06"] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
glam = "0.32.0"
rand = "0.10.0"
# Disable unnecessary formats.
image = { version = "0.25.0", default-features = false, features = ["jpeg"] }
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
# Use rayon in raytracing example on non-web platforms.
rayon = "1.5.1"
# Enable criterion benchmarking on non-web platforms.
criterion = { version = "0.8.1", default-features = false, features = [
"cargo_bench_support",
] }
[target.'cfg(target_os = "android")'.dev-dependencies]
# Use NativeActivity on Android.
winit = { version = "0.30.0", features = ["android-native-activity"] }
android-activity = "0.6"
[target.'cfg(target_family = "wasm")'.dev-dependencies]
# Add extra dependencies for making debugging easier on Web.
wasm-bindgen-test = "0.3"
console_error_panic_hook = "0.1"
tracing-web = "0.1"
# Allow `rand` crate to compile.
getrandom = { version = "0.4.1", features = ["wasm_js"] }
# DRM example.
[target.'cfg(not(any(target_os = "android", target_vendor = "apple", target_os = "redox", target_family = "wasm", target_os = "windows")))'.dev-dependencies]
rustix = { version = "1.0.1", features = ["event"] }