From fee9438b826e117500ff36b0a4dde1d8ee402f19 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Sun, 19 Nov 2023 22:33:40 +0100 Subject: [PATCH] Automatically disable the xr module on macos --- .github/workflows/ci.yml | 6 +----- src/main.rs | 8 ++++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16f40e6..2c3110b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,12 +37,8 @@ jobs: - name: Install Dependencies if: matrix.os == 'ubuntu-latest' run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libopenxr-loader1 libopenxr-dev - - name: Run cargo test (not mac, so with xr) - if: matrix.os != 'macos-latest' + - name: Run cargo test run: cargo test - - name: Run cargo test (mac, so without xr) - if: matrix.os == 'macos-latest' - run: cargo test --no-default-features # Run cargo clippy -- -D warnings clippy: diff --git a/src/main.rs b/src/main.rs index 8417643..c723832 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,21 +6,21 @@ use bevy::{ }; use std::f32::consts::*; use tilemap::TileMap; -#[cfg(feature = "xr")] +#[cfg(all(feature = "xr", not(target_os = "macos")))] use xr::XRPlugin; use bevy_flycam::prelude::*; -#[cfg(feature = "xr")] +#[cfg(all(feature = "xr", not(target_os = "macos")))] use bevy_oxr::DefaultXrPlugins; mod tilemap; -#[cfg(feature = "xr")] +#[cfg(all(feature = "xr", not(target_os = "macos")))] mod xr; fn main() { let mut app = App::new(); if std::env::args().any(|arg| arg == "xr") { - #[cfg(feature = "xr")] + #[cfg(all(feature = "xr", not(target_os = "macos")))] app.add_plugins(DefaultXrPlugins).add_plugins(XRPlugin); } else { app.add_plugins(DefaultPlugins);