Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically disable the xr module on macos #14

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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