From 73aa5806e7f8ee35c63b9b908b49f3fd1cbc26e1 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Sun, 19 Nov 2023 14:27:21 +0100 Subject: [PATCH] reenable mac support by disabling xr on mac --- Cargo.toml | 7 +++++-- src/main.rs | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 393c226..447417d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,13 +18,16 @@ bevy = { version = "0.12", features = [ "jpeg", ] } ## NOT the local file bevy, the one from the net bevy_flycam = { git = "https://github.com/sburris0/bevy_flycam" } ## control -bevy_oxr = { git = "https://github.com/awtterpip/bevy_openxr" } +bevy_oxr = { git = "https://github.com/awtterpip/bevy_openxr", optional = true } ## bevy_config_cam = { git = "https://github.com/BlackPhlox/bevy_config_cam" } ## { version = "0.3.0"} glam = "0" [features] -#xr = ["bevy_oxr"] +xr = ["dep:bevy_oxr"] + +[target.'cfg(not(target_os="macos"))'.features] +default = ["xr"] #jpeg = ["bevy_internal/jpeg"] diff --git a/src/main.rs b/src/main.rs index 14c0377..8417643 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,17 +6,21 @@ use bevy::{ }; use std::f32::consts::*; use tilemap::TileMap; +#[cfg(feature = "xr")] use xr::XRPlugin; use bevy_flycam::prelude::*; +#[cfg(feature = "xr")] use bevy_oxr::DefaultXrPlugins; mod tilemap; +#[cfg(feature = "xr")] mod xr; fn main() { let mut app = App::new(); if std::env::args().any(|arg| arg == "xr") { + #[cfg(feature = "xr")] app.add_plugins(DefaultXrPlugins).add_plugins(XRPlugin); } else { app.add_plugins(DefaultPlugins);