Skip to content

Commit

Permalink
download openvr sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Vixea committed Mar 28, 2024
1 parent c2e864c commit bc15660
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 9,847 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ 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 @@ -124,7 +127,9 @@ jobs:
override: true
- uses: Swatinem/rust-cache@v1

- run: sudo apt update && sudo apt install libgtk-3-dev
- run: |
sudo apt update && sudo apt install libgtk-3-dev
cargo xtask prepare-deps --platform linux
- 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.

17 changes: 14 additions & 3 deletions alvr/server/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ fn get_ffmpeg_path() -> PathBuf {
}
}

fn get_openvr_path() -> PathBuf {
let openvr_path = alvr_filesystem::deps_dir()
.join(if cfg!(target_os = "linux") {
"linux"
} else {
"windows"
})
.join("openvr");
openvr_path
}

#[cfg(all(target_os = "linux", feature = "gpl"))]
fn get_linux_x264_path() -> PathBuf {
alvr_filesystem::deps_dir().join("linux/x264/alvr_build")
Expand All @@ -24,7 +35,7 @@ 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 _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 +76,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(get_openvr_path().join("headers"))
.include("cpp");

if platform_name == "windows" {
Expand Down Expand Up @@ -183,7 +194,7 @@ fn main() {
if platform_name != "macos" {
println!(
"cargo:rustc-link-search=native={}",
cpp_dir.join("openvr/lib").to_string_lossy()
get_openvr_path().join("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 bc15660

Please sign in to comment.