Skip to content

Commit ee0115b

Browse files
committed
[update] default dependency configurations.
1 parent 02f3ba6 commit ee0115b

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

crates/lambda-rs-platform/Cargo.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ shaderc = "=0.7"
1717
cfg-if = "=1.0.0"
1818
rand = "=0.8.5"
1919
obj-rs = "=0.7.0"
20-
gfx-backend-empty = "=0.9.0"
20+
default_backend = { package = "gfx-backend-empty", version = "=0.9.0", optional = true}
2121

2222
# GFX-RS backends
2323
gfx-backend-gl = { version="=0.9.0", optional = true }
@@ -43,17 +43,14 @@ gfx-with-dx12=["dep:gfx-backend-dx12"]
4343
crate-type = ["cdylib", "rlib"]
4444
incremental = true
4545

46-
[target.'cfg(all(unix, not(target_os = "macos"), not(feature = "gfx-with-opengl")))'.dependencies.default_backend]
46+
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies.gfx-backend-gl]
4747
package = "gfx-backend-gl"
4848
version = "=0.9.0"
49-
optional = true
5049

51-
[target.'cfg(all(target_os = "macos", not(feature = "gfx-with-metal")))'.dependencies.default_backend]
50+
[target.'cfg(all(target_os = "macos"))'.dependencies.gfx-backend-metal]
5251
package = "gfx-backend-metal"
5352
version = "=0.9.0"
54-
optional = true
5553

56-
[target.'cfg(all(windows, not(feature = "gfx-with-dx12")))'.dependencies.default_backend]
54+
[target.'cfg(all(windows))'.dependencies.gfx-backend-dx12]
5755
package = "gfx-backend-dx12"
5856
version = "=0.9.0"
59-
optional = true

crates/lambda-rs-platform/src/gfx/api.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
//! implementations to use.
33
44
cfg_if::cfg_if! {
5-
if #[cfg(feature = "gfx-with-gl")] {
5+
if #[cfg(any(feature = "gfx-with-gl", all(feature = "detect-platform", unix, not(target_os="macos")) ))] {
66
pub use gfx_backend_gl as RenderingAPI;
7-
} else if #[cfg(feature = "gfx-with-metal")] {
7+
} else if #[cfg(any(feature = "gfx-with-metal", all(feature = "detect-platform", target_os="macos")))] {
88
pub use gfx_backend_metal as RenderingAPI;
99
} else if #[cfg(feature = "gfx-with-vulkan")] {
1010
pub use gfx_backend_vulkan as RenderingAPI;
1111
} else if #[cfg(feature = "gfx-with-dx11")] {
1212
pub use gfx_backend_dx11 as RenderingAPI;
13-
} else if #[cfg(feature = "gfx-with-dx12")] {
13+
} else if #[cfg(any(feature = "gfx-with-dx12", all(windows, feature = "detect-platform")))] {
1414
pub use gfx_backend_dx12 as RenderingAPI;
15-
} else if #[cfg(all(feature = "detect-platform"))] {
16-
pub use default_backend as RenderingAPI;
1715
} else {
1816
pub use gfx_backend_empty as RenderingAPI;
17+
println!("[WARN] No rendering backend specified, using empty backend.");
1918
}
2019
}

0 commit comments

Comments
 (0)