diff --git a/Cargo.toml b/Cargo.toml index 534191e..f7dfe4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,8 @@ version = "0.1.0" edition = "2021" [features] -default = ["openxr/mint"] +default = ["openxr/mint", "linked"] +linked = ["openxr/linked"] [dependencies] anyhow = "1.0.75" @@ -16,7 +17,7 @@ wgpu-core = { version = "0.17.1", features = ["vulkan"] } wgpu-hal = "0.17.1" [target.'cfg( target_os = "linux" )'.dependencies] -openxr = { version = "0.17.1", features = ["linked"] } +openxr = "0.17.1" [target.'cfg(not(target_os = "linux"))'.dependencies] openxr = { version = "0.17.1", features = ["static"] } diff --git a/src/graphics/mod.rs b/src/graphics/mod.rs index 2eb26dd..2a0a92d 100644 --- a/src/graphics/mod.rs +++ b/src/graphics/mod.rs @@ -36,9 +36,9 @@ pub fn initialize_xr_graphics( } pub fn xr_entry() -> xr::Entry { - #[cfg(target_os = "linux")] + #[cfg(feature = "linked")] let entry = xr::Entry::linked(); - #[cfg(not(target_os = "linux"))] + #[cfg(not(feature = "linked"))] let entry = unsafe { xr::Entry::load().unwrap() }; entry }