Skip to content

Commit

Permalink
download openvr sdk (#2046)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vixea authored Mar 28, 2024
1 parent d564661 commit 4a831ee
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 9,850 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
components: clippy
- uses: Swatinem/rust-cache@v1

- run: cargo xtask prepare-deps --platform windows

- uses: ErichDonGubler/clippy-check@fix-windows-lf-breaking-reports
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -65,6 +67,8 @@ jobs:
components: clippy
- uses: Swatinem/rust-cache@v1

- run: cargo xtask prepare-deps --platform macos

- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -106,13 +110,13 @@ jobs:
# Create folder without content to make the build succeed
- run: |
mkdir -p deps/android_openxr/arm64-v8a
cargo xtask prepare-deps --platform android
- name: Build client
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
working-directory: ./alvr/client_openxr
run:
cargo apk build
cargo xtask build-client

tests:
runs-on: ubuntu-latest
Expand All @@ -124,7 +128,13 @@ jobs:
override: true
- uses: Swatinem/rust-cache@v1

- run: sudo apt update && sudo apt install libgtk-3-dev
- name: Build and install dependencies
env:
RUST_BACKTRACE: 1
run: |
sudo apt update
sudo apt install build-essential pkg-config nasm libva-dev libdrm-dev libvulkan-dev libx264-dev libx265-dev cmake libasound2-dev libjack-jackd2-dev libxrandr-dev libunwind-dev libgtk-3-dev
cargo xtask prepare-deps --platform linux --no-nvidia
- name: Run tests
uses: actions-rs/cargo@v1
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions alvr/server/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use alvr_filesystem as afs;
use std::{env, path::PathBuf};

fn get_ffmpeg_path() -> PathBuf {
Expand All @@ -24,7 +25,6 @@ fn get_linux_x264_path() -> PathBuf {
fn main() {
let platform_name = env::var("CARGO_CFG_TARGET_OS").unwrap();
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let cpp_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()).join("cpp");

let platform_subpath = match platform_name.as_str() {
"windows" => "cpp/platform/win32",
Expand Down Expand Up @@ -65,7 +65,7 @@ fn main() {
.files(source_files_paths)
.flag_if_supported("-isystemcpp/openvr/headers") // silences many warnings from openvr headers
.flag_if_supported("-std=c++17")
.include("cpp/openvr/headers")
.include(afs::deps_dir().join("openvr/headers"))
.include("cpp");

if platform_name == "windows" {
Expand Down Expand Up @@ -180,10 +180,16 @@ fn main() {
.write_to_file(out_dir.join("bindings.rs"))
.unwrap();

if platform_name != "macos" {
if platform_name == "linux" {
println!(
"cargo:rustc-link-search=native={}",
cpp_dir.join("openvr/lib").to_string_lossy()
afs::deps_dir().join("openvr/lib/linux64").to_string_lossy()
);
println!("cargo:rustc-link-lib=openvr_api");
} else if platform_name == "windows" {
println!(
"cargo:rustc-link-search=native={}",
afs::deps_dir().join("openvr/lib/win64").to_string_lossy()
);
println!("cargo:rustc-link-lib=openvr_api");
}
Expand Down
1 change: 0 additions & 1 deletion alvr/server/cpp/bin/.gitignore

This file was deleted.

Binary file removed alvr/server/cpp/bin/windows/openvr_api.dll
Binary file not shown.
Binary file removed alvr/server/cpp/bin/windows/vcruntime140_1.dll
Binary file not shown.
Loading

0 comments on commit 4a831ee

Please sign in to comment.