Skip to content

Commit 5190472

Browse files
authored
chore: use workspace dependencies everywhere
To reduce the amount of duplication in 'Cargo.toml's when we split into different crates.
1 parent eab03dc commit 5190472

File tree

2 files changed

+161
-93
lines changed

2 files changed

+161
-93
lines changed

Cargo.toml

Lines changed: 153 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,99 @@
1+
[workspace]
2+
members = ["dpi", "winit-core"]
3+
resolver = "2"
4+
5+
[workspace.package]
6+
edition = "2021"
7+
license = "Apache-2.0"
8+
repository = "https://github.com/rust-windowing/winit"
9+
rust-version = "1.80"
10+
11+
[workspace.dependencies]
12+
# Workspace dependencies.
13+
# `winit` has no version here to allow using it in dev deps for docs.
14+
winit = { path = "." }
15+
winit-core = { version = "0.0.0", path = "winit-core" }
16+
17+
# Core dependencies.
18+
bitflags = "2"
19+
cfg_aliases = "0.2.1"
20+
cursor-icon = "1.1.0"
21+
dpi = { version = "0.1.2", path = "dpi" }
22+
mint = "0.5.6"
23+
rwh_06 = { package = "raw-window-handle", version = "0.6", features = ["std"] }
24+
serde = { version = "1", features = ["serde_derive"] }
25+
smol_str = "0.3"
26+
tracing = { version = "0.1.40", default-features = false }
27+
28+
# Dev dependencies.
29+
image = { version = "0.25.0", default-features = false }
30+
softbuffer = { version = "0.4.6", default-features = false, features = [
31+
"x11",
32+
"x11-dlopen",
33+
"wayland",
34+
"wayland-dlopen",
35+
] }
36+
tracing-subscriber = "0.3.18"
37+
38+
# Android dependencies.
39+
android-activity = "0.6.0"
40+
ndk = { version = "0.9.0", features = ["rwh_06"], default-features = false }
41+
42+
# Apple dependencies.
43+
block2 = "0.6.1"
44+
dispatch2 = { version = "0.3.0", default-features = false, features = ["std", "objc2"] }
45+
objc2 = "0.6.1"
46+
objc2-app-kit = { version = "0.3.1", default-features = false }
47+
objc2-core-foundation = { version = "0.3.1", default-features = false }
48+
objc2-core-graphics = { version = "0.3.1", default-features = false }
49+
objc2-core-video = { version = "0.3.1", default-features = false }
50+
objc2-foundation = { version = "0.3.1", default-features = false }
51+
objc2-ui-kit = { version = "0.3.1", default-features = false }
52+
53+
# Windows dependencies.
54+
unicode-segmentation = "1.7.1"
55+
windows-sys = "0.59.0"
56+
57+
# Linux dependencies.
58+
ahash = { version = "0.8.7", features = ["no-rng"] }
59+
bytemuck = { version = "1.13.1", default-features = false }
60+
calloop = "0.13.0"
61+
libc = "0.2.64"
62+
memmap2 = "0.9.0"
63+
percent-encoding = "2.0"
64+
rustix = { version = "0.38.4", default-features = false }
65+
sctk = { package = "smithay-client-toolkit", version = "0.19.2", default-features = false, features = [
66+
"calloop",
67+
] }
68+
sctk-adwaita = { version = "0.10.1", default-features = false }
69+
wayland-backend = { version = "0.3.10", default-features = false, features = ["client_system"] }
70+
wayland-client = "0.31.10"
71+
wayland-protocols = { version = "0.32.8", features = ["staging"] }
72+
wayland-protocols-plasma = { version = "0.3.8", features = ["client"] }
73+
x11-dl = "2.19.1"
74+
x11rb = { version = "0.13.0", default-features = false }
75+
xkbcommon-dl = "0.4.2"
76+
77+
# Orbital dependencies.
78+
orbclient = { version = "0.3.47", default-features = false }
79+
redox_syscall = "0.5.7"
80+
81+
# Web dependencies.
82+
atomic-waker = "1"
83+
concurrent-queue = { version = "2", default-features = false }
84+
console_error_panic_hook = "0.1"
85+
js-sys = "0.3.70"
86+
pin-project = "1"
87+
tracing-web = "0.1"
88+
wasm-bindgen = "0.2.93"
89+
wasm-bindgen-futures = "0.4.43"
90+
wasm-bindgen-test = "0.3"
91+
web-time = "1"
92+
web_sys = { package = "web-sys", version = "0.3.70" }
93+
94+
##
95+
## Top-level Winit crate.
96+
##
197
[package]
298
authors = ["The winit contributors", "Pierre Krieger <[email protected]>"]
399
categories = ["gui"]
@@ -80,45 +176,40 @@ wayland-dlopen = ["wayland-backend/dlopen"]
80176
x11 = ["x11-dl", "bytemuck", "percent-encoding", "xkbcommon-dl/x11", "x11rb"]
81177

82178
[build-dependencies]
83-
cfg_aliases = "0.2.1"
179+
cfg_aliases.workspace = true
84180

85181
[dependencies]
86-
bitflags = "2"
87-
cursor-icon = "1.1.0"
88-
dpi = { version = "0.1.2", path = "dpi" }
89-
rwh_06 = { package = "raw-window-handle", version = "0.6", features = ["std"] }
182+
bitflags.workspace = true
183+
cursor-icon.workspace = true
184+
dpi.workspace = true
185+
rwh_06.workspace = true
90186
serde = { workspace = true, optional = true }
91-
smol_str = "0.3"
92-
tracing = { version = "0.1.40", default-features = false }
93-
winit-core = { version = "0.0.0", path = "winit-core" }
187+
smol_str.workspace = true
188+
tracing.workspace = true
189+
winit-core.workspace = true
94190

95191
[dev-dependencies]
96-
image = { version = "0.25.0", default-features = false, features = ["png"] }
97-
tracing = { version = "0.1.40", default-features = false, features = ["log"] }
98-
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
192+
image = { workspace = true, features = ["png"] }
193+
tracing = { workspace = true, features = ["log"] }
194+
tracing-subscriber = { workspace = true, features = ["env-filter"] }
99195

100196
[target.'cfg(not(target_os = "android"))'.dev-dependencies]
101-
softbuffer = { version = "0.4.6", default-features = false, features = [
102-
"x11",
103-
"x11-dlopen",
104-
"wayland",
105-
"wayland-dlopen",
106-
] }
197+
softbuffer.workspace = true
107198

108199
# Android
109200
[target.'cfg(target_os = "android")'.dependencies]
110-
android-activity = "0.6.0"
111-
ndk = { version = "0.9.0", features = ["rwh_06"], default-features = false }
201+
android-activity.workspace = true
202+
ndk.workspace = true
112203

113204
# AppKit or UIKit
114205
[target.'cfg(target_vendor = "apple")'.dependencies]
115-
block2 = "0.6.1"
116-
dispatch2 = { version = "0.3.0", default-features = false, features = ["std", "objc2"] }
117-
objc2 = "0.6.1"
206+
block2.workspace = true
207+
dispatch2.workspace = true
208+
objc2.workspace = true
118209

119210
# AppKit
120211
[target.'cfg(target_os = "macos")'.dependencies]
121-
objc2-app-kit = { version = "0.3.1", default-features = false, features = [
212+
objc2-app-kit = { workspace = true, features = [
122213
"std",
123214
"objc2-core-foundation",
124215
"NSAppearance",
@@ -150,7 +241,7 @@ objc2-app-kit = { version = "0.3.1", default-features = false, features = [
150241
"NSWindowScripting",
151242
"NSWindowTabGroup",
152243
] }
153-
objc2-core-foundation = { version = "0.3.1", default-features = false, features = [
244+
objc2-core-foundation = { workspace = true, features = [
154245
"std",
155246
"block2",
156247
"CFBase",
@@ -160,7 +251,7 @@ objc2-core-foundation = { version = "0.3.1", default-features = false, features
160251
"CFString",
161252
"CFUUID",
162253
] }
163-
objc2-core-graphics = { version = "0.3.1", default-features = false, features = [
254+
objc2-core-graphics = { workspace = true, features = [
164255
"std",
165256
"libc",
166257
"CGDirectDisplay",
@@ -170,14 +261,14 @@ objc2-core-graphics = { version = "0.3.1", default-features = false, features =
170261
"CGRemoteOperation",
171262
"CGWindowLevel",
172263
] }
173-
objc2-core-video = { version = "0.3.1", default-features = false, features = [
264+
objc2-core-video = { workspace = true, features = [
174265
"std",
175266
"objc2-core-graphics",
176267
"CVBase",
177268
"CVReturn",
178269
"CVDisplayLink",
179270
] }
180-
objc2-foundation = { version = "0.3.1", default-features = false, features = [
271+
objc2-foundation = { workspace = true, features = [
181272
"std",
182273
"block2",
183274
"objc2-core-foundation",
@@ -202,14 +293,14 @@ objc2-foundation = { version = "0.3.1", default-features = false, features = [
202293

203294
# UIKit
204295
[target.'cfg(all(target_vendor = "apple", not(target_os = "macos")))'.dependencies]
205-
objc2-core-foundation = { version = "0.3.1", default-features = false, features = [
296+
objc2-core-foundation = { workspace = true, features = [
206297
"std",
207298
"CFCGTypes",
208299
"CFBase",
209300
"CFRunLoop",
210301
"CFString",
211302
] }
212-
objc2-foundation = { version = "0.3.1", default-features = false, features = [
303+
objc2-foundation = { workspace = true, features = [
213304
"std",
214305
"block2",
215306
"objc2-core-foundation",
@@ -222,7 +313,7 @@ objc2-foundation = { version = "0.3.1", default-features = false, features = [
222313
"NSThread",
223314
"NSSet",
224315
] }
225-
objc2-ui-kit = { version = "0.3.1", default-features = false, features = [
316+
objc2-ui-kit = { workspace = true, features = [
226317
"std",
227318
"objc2-core-foundation",
228319
"UIApplication",
@@ -249,8 +340,8 @@ objc2-ui-kit = { version = "0.3.1", default-features = false, features = [
249340

250341
# Windows
251342
[target.'cfg(target_os = "windows")'.dependencies]
252-
unicode-segmentation = "1.7.1"
253-
windows-sys = { version = "0.59.0", features = [
343+
unicode-segmentation.workspace = true
344+
windows-sys = { workspace = true, features = [
254345
"Win32_Devices_HumanInterfaceDevice",
255346
"Win32_Foundation",
256347
"Win32_Globalization",
@@ -280,30 +371,21 @@ windows-sys = { version = "0.59.0", features = [
280371

281372
# Linux
282373
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_vendor = "apple"))))'.dependencies]
283-
ahash = { version = "0.8.7", features = ["no-rng"], optional = true }
284-
bytemuck = { version = "1.13.1", default-features = false, optional = true }
285-
calloop = "0.13.0"
286-
libc = "0.2.64"
287-
memmap2 = { version = "0.9.0", optional = true }
288-
percent-encoding = { version = "2.0", optional = true }
289-
rustix = { version = "0.38.4", default-features = false, features = [
290-
"std",
291-
"system",
292-
"thread",
293-
"process",
294-
] }
295-
sctk = { package = "smithay-client-toolkit", version = "0.19.2", default-features = false, features = [
296-
"calloop",
297-
], optional = true }
298-
sctk-adwaita = { version = "0.10.1", default-features = false, optional = true }
299-
wayland-backend = { version = "0.3.10", default-features = false, features = [
300-
"client_system",
301-
], optional = true }
302-
wayland-client = { version = "0.31.10", optional = true }
303-
wayland-protocols = { version = "0.32.8", features = ["staging"], optional = true }
304-
wayland-protocols-plasma = { version = "0.3.8", features = ["client"], optional = true }
305-
x11-dl = { version = "2.19.1", optional = true }
306-
x11rb = { version = "0.13.0", default-features = false, features = [
374+
ahash = { workspace = true, optional = true }
375+
bytemuck = { workspace = true, optional = true }
376+
calloop.workspace = true
377+
libc.workspace = true
378+
memmap2 = { workspace = true, optional = true }
379+
percent-encoding = { workspace = true, optional = true }
380+
rustix = { workspace = true, features = ["std", "system", "thread", "process"] }
381+
sctk = { workspace = true, optional = true }
382+
sctk-adwaita = { workspace = true, optional = true }
383+
wayland-backend = { workspace = true, optional = true }
384+
wayland-client = { workspace = true, optional = true }
385+
wayland-protocols = { workspace = true, optional = true }
386+
wayland-protocols-plasma = { workspace = true, optional = true }
387+
x11-dl = { workspace = true, optional = true }
388+
x11rb = { workspace = true, optional = true, features = [
307389
"allow-unsafe-code",
308390
"cursor",
309391
"dl-libxcb",
@@ -312,22 +394,22 @@ x11rb = { version = "0.13.0", default-features = false, features = [
312394
"sync",
313395
"xinput",
314396
"xkb",
315-
], optional = true }
316-
xkbcommon-dl = "0.4.2"
397+
] }
398+
xkbcommon-dl.workspace = true
317399

318400
# Orbital
319401
[target.'cfg(target_os = "redox")'.dependencies]
320-
orbclient = { version = "0.3.47", default-features = false }
321-
redox_syscall = "0.5.7"
402+
orbclient.workspace = true
403+
redox_syscall.workspace = true
322404

323405
# Web
324406
[target.'cfg(target_family = "wasm")'.dependencies]
325-
js-sys = "0.3.70"
326-
pin-project = "1"
327-
wasm-bindgen = "0.2.93"
328-
wasm-bindgen-futures = "0.4.43"
329-
web-time = "1"
330-
web_sys = { package = "web-sys", version = "0.3.70", features = [
407+
js-sys.workspace = true
408+
pin-project.workspace = true
409+
wasm-bindgen.workspace = true
410+
wasm-bindgen-futures.workspace = true
411+
web-time.workspace = true
412+
web_sys = { workspace = true, features = [
331413
"AbortController",
332414
"AbortSignal",
333415
"Blob",
@@ -381,31 +463,17 @@ web_sys = { package = "web-sys", version = "0.3.70", features = [
381463
] }
382464

383465
[target.'cfg(all(target_family = "wasm", target_feature = "atomics"))'.dependencies]
384-
atomic-waker = "1"
385-
concurrent-queue = { version = "2", default-features = false }
466+
atomic-waker.workspace = true
467+
concurrent-queue.workspace = true
386468

387469
[target.'cfg(target_family = "wasm")'.dev-dependencies]
388-
console_error_panic_hook = "0.1"
389-
tracing-web = "0.1"
390-
wasm-bindgen-test = "0.3"
470+
console_error_panic_hook.workspace = true
471+
tracing-web.workspace = true
472+
wasm-bindgen-test.workspace = true
391473

392474
[[example]]
393475
doc-scrape-examples = true
394476
name = "window"
395477

396478
[[example]]
397479
name = "child_window"
398-
399-
[workspace]
400-
members = ["dpi", "winit-core"]
401-
resolver = "2"
402-
403-
[workspace.package]
404-
edition = "2021"
405-
license = "Apache-2.0"
406-
repository = "https://github.com/rust-windowing/winit"
407-
rust-version = "1.80"
408-
409-
[workspace.dependencies]
410-
mint = "0.5.6"
411-
serde = { version = "1", features = ["serde_derive"] }

winit-core/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ version = "0.0.0"
1616
serde = ["dep:serde", "cursor-icon/serde", "smol_str/serde", "dpi/serde", "bitflags/serde"]
1717

1818
[dependencies]
19-
bitflags = "2"
20-
cursor-icon = "1.1.0"
21-
dpi = { version = "0.1.1", path = "../dpi" }
22-
rwh_06 = { package = "raw-window-handle", version = "0.6", features = ["std"] }
19+
bitflags.workspace = true
20+
cursor-icon.workspace = true
21+
dpi.workspace = true
22+
rwh_06.workspace = true
2323
serde = { workspace = true, optional = true }
24-
smol_str = "0.3"
24+
smol_str.workspace = true
2525

2626
[target.'cfg(target_family = "wasm")'.dependencies]
27-
web-time = "1"
27+
web-time.workspace = true
2828

2929
[build-dependencies]
30-
cfg_aliases = "0.2.1"
30+
cfg_aliases.workspace = true
3131

3232
[dev-dependencies]
33-
winit = { path = ".." }
33+
winit.workspace = true

0 commit comments

Comments
 (0)