Skip to content

Commit

Permalink
fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmarni-Dev committed Dec 31, 2023
1 parent 86cb8af commit d0a70a4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ license = "MIT/Apache-2.0"

[features]
default = []
force-link = ["openxr/linked"]

[workspace]
members = ["examples/android", "examples/demo"]
Expand All @@ -23,11 +24,10 @@ wgpu = "0.17.1"
wgpu-core = { version = "0.17.1", features = ["vulkan"] }
wgpu-hal = "0.17.1"

[target.'cfg(all(target_family = "windows", not(target_arch = "wasm32")) )'.dependencies]
openxr = { version = "0.17.1", features = ["mint", "linked"] }
[target.'cfg(windows)'.dependencies]
openxr = { version = "0.17.1", features = ["linked","static","mint"] }
[target.'cfg(all(target_family = "unix", not(target_arch = "wasm32")) )'.dependencies]
openxr = { version = "0.17.1", features = ["mint"] }

[target.'cfg(all(not(target_family = "unix"), not(target_arch = "wasm32")))'.dependencies]
openxr = { version = "0.17.1", features = ["mint", "static"] }

Expand Down
6 changes: 1 addition & 5 deletions examples/android/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@ license = "MIT OR Apache-2.0"
name = "bevy_openxr_android"
crate-type = ["rlib", "cdylib"]

[target.'cfg(not(target_os="android"))'.dependencies.bevy_oxr]
path = "../../"
default-features = true


[dependencies]
bevy_oxr = { path = "../..", default-features = false }
bevy_oxr.path = "../.."
bevy = "0.12"
openxr = { git = "https://github.com/Ralith/openxrs", features = ["mint"] }

Expand Down
4 changes: 2 additions & 2 deletions src/graphics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ pub fn initialize_xr_graphics(
}

pub fn xr_entry() -> anyhow::Result<xr::Entry> {
#[cfg(feature = "linked")]
#[cfg(windows)]
let entry = Ok(xr::Entry::linked());
#[cfg(not(feature = "linked"))]
#[cfg(not(windows))]
let entry = unsafe { xr::Entry::load().map_err(|e| anyhow::anyhow!(e)) };
entry
}

0 comments on commit d0a70a4

Please sign in to comment.