Skip to content

Commit

Permalink
Compile Windows code regardless of the target OS
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Jan 17, 2024
1 parent 01df0b6 commit 22deed7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ egui_extras = { version = "0.24", optional = true, default-features = false }
# Only needed for public-winapi interop helpers
winapi = { version = "0.3.9", features = ["d3d12", "winerror", "impl-default", "impl-debug"], optional = true }

[target.'cfg(windows)'.dependencies.windows]
[dependencies.windows]
version = ">=0.51,<=0.52"
features = [
"Win32_Foundation",
Expand All @@ -57,7 +57,7 @@ env_logger = "0.10"
[target.'cfg(windows)'.dev-dependencies]
winapi = { version = "0.3.9", features = ["d3d12", "d3d12sdklayers", "dxgi1_6", "winerror", "impl-default", "impl-debug", "winuser", "windowsx", "libloaderapi"] }

[target.'cfg(windows)'.dev-dependencies.windows]
[dev-dependencies.windows]
version = ">=0.51,<=0.52"
features = [
"Win32_Foundation",
Expand All @@ -81,9 +81,9 @@ name = "d3d12-buffer-winrs"
required-features = ["d3d12"]

[features]
visualizer = ["egui", "egui_extras"]
vulkan = ["ash"]
d3d12 = ["windows"]
visualizer = ["dep:egui", "dep:egui_extras"]
vulkan = ["dep:ash"]
d3d12 = ["dep:windows"]
# Expose helper functionality for winapi types to interface with gpu-allocator, which is primarily windows-rs driven
public-winapi = ["dep:winapi"]

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub mod visualizer;
#[cfg(feature = "vulkan")]
pub mod vulkan;

#[cfg(all(windows, feature = "d3d12"))]
#[cfg(feature = "d3d12")]
pub mod d3d12;

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
Expand Down

0 comments on commit 22deed7

Please sign in to comment.