Skip to content

Commit

Permalink
Automatically disable the xr module on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Nov 19, 2023
1 parent 1986dc3 commit fee9438
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fee9438

Please sign in to comment.