Skip to content

Commit d1f4b40

Browse files
authored
Depend on Windows crates only on Windows (#93)
1 parent 7318ecb commit d1f4b40

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Cargo.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,25 @@ thiserror = "1.0"
2424
# Only needed for vulkan. Disable all default features as good practice,
2525
# such as the ability to link/load a Vulkan library.
2626
ash = { version = "0.35", optional = true, default-features = false, features = ["debug"] }
27-
# Only needed for d3d12.
28-
winapi = { version = "0.3.9", features = ["d3d12", "winerror", "impl-default", "impl-debug"], optional = true }
2927
# Only needed for visualizer.
3028
imgui = { version = "0.8", optional = true }
3129
imgui-winit-support = { version = "0.8", optional = true, default-features = false, features = ["winit-26"] }
3230

31+
[target.'cfg(windows)'.dependencies]
32+
# Only needed for d3d12.
33+
winapi = { version = "0.3.9", features = ["d3d12", "winerror", "impl-default", "impl-debug"], optional = true }
34+
3335
[dev-dependencies]
3436
# Enable the "loaded" feature to be able to access the Vulkan entrypoint.
3537
ash = { version = "0.35", default-features = false, features = ["debug", "loaded"] }
3638
ash-window = "0.9"
3739
raw-window-handle = "0.4"
38-
winapi = { version = "0.3.9", features = ["d3d12", "d3d12sdklayers", "dxgi1_6", "winerror", "impl-default", "impl-debug", "winuser", "windowsx", "libloaderapi"] }
3940
winit = "0.26"
4041

41-
[dev-dependencies.windows]
42+
[target.'cfg(windows)'.dev-dependencies]
43+
winapi = { version = "0.3.9", features = ["d3d12", "d3d12sdklayers", "dxgi1_6", "winerror", "impl-default", "impl-debug", "winuser", "windowsx", "libloaderapi"] }
44+
45+
[target.'cfg(windows)'.dev-dependencies.windows]
4246
version = "0.29"
4347
features = [
4448
"Win32_Foundation",

0 commit comments

Comments
 (0)