Skip to content

Update to OpenVR SDK 1.0.7 #2

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

Closed
wants to merge 6 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "openvr"]
path = openvr
url = https://github.com/ValveSoftware/openvr.git
10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ authors = [
license = "MIT"
description = "Raw unsafe system binding for openvr"
repository = "https://github.com/rust-openvr/rust-openvr-sys"

exclude = [
"openvr/samples/*",
"openvr/bin/*",
"openvr/lib/*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excluding the libs might cause issues when someone downloads rust-openvr-sys from cargo I guess.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The binaries in the upstream repository are excluded as of 50e98d5 because the changes include building the OpenVR client code from source and statically linking it. This should make redistributing binaries which use this library much easier, as there's no need to patch runpaths or muck about with dynamic library search paths.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, thats great! Thanks

"openvr/controller_callouts/*",
]
build = "build.rs"

[build-dependencies]
cmake = "0.1"

[lib]
name = "openvr_sys"
path = "lib.rs"
30 changes: 17 additions & 13 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
#[cfg(target_os="macos")]
fn main() {
println!("cargo:rustc-link-search={}/openvr/lib/osx32", env!("CARGO_MANIFEST_DIR"));
println!("cargo:rustc-link-search={}/openvr/bin/osx32", env!("CARGO_MANIFEST_DIR"));
}
extern crate cmake;

#[cfg(target_os="linux")]
fn main() {
println!("cargo:rustc-link-search={}/openvr/lib/linux64", env!("CARGO_MANIFEST_DIR"));
println!("cargo:rustc-link-search={}/openvr/bin/linux64", env!("CARGO_MANIFEST_DIR"));
}
let mut cfg = cmake::Config::new("openvr");

#[cfg(target_os="windows")]
fn main() {
println!("cargo:rustc-link-search={}/openvr/lib/win64", env!("CARGO_MANIFEST_DIR"));
println!("cargo:rustc-link-search={}/openvr/bin/win64", env!("CARGO_MANIFEST_DIR"));
// Work around broken cmake build
#[cfg(windows)]
cfg.cxxflag("/DWIN32");

let dst = cfg.build();
println!("cargo:rustc-link-search=native={}/lib", dst.display());

#[cfg(all(windows, target_pointer_width = "64"))]
println!("cargo:rustc-link-lib=static=openvr_api64");

#[cfg(not(all(windows, target_pointer_width = "64")))]
println!("cargo:rustc-link-lib=static=openvr_api");

#[cfg(target_os="linux")]
println!("cargo:rustc-link-lib=stdc++");
}
9,027 changes: 7,185 additions & 1,842 deletions lib.rs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions openvr
Submodule openvr added at dc860f
27 changes: 0 additions & 27 deletions openvr/LICENSE

This file was deleted.

9 changes: 0 additions & 9 deletions openvr/README

This file was deleted.

Binary file removed openvr/bin/linux32/libopenvr_api.so
Binary file not shown.
Binary file removed openvr/bin/linux32/libopenvr_api.so.dbg
Binary file not shown.
Binary file removed openvr/bin/linux64/libopenvr_api.so
Binary file not shown.
Binary file removed openvr/bin/linux64/libopenvr_api.so.dbg
Binary file not shown.
Binary file removed openvr/bin/osx32/libopenvr_api.dylib
Binary file not shown.
20 changes: 0 additions & 20 deletions openvr/bin/osx32/libopenvr_api.dylib.dSYM/Contents/Info.plist

This file was deleted.

Binary file not shown.
Binary file removed openvr/bin/win32/openvr_api.dll
Binary file not shown.
Binary file removed openvr/bin/win64/openvr_api.dll
Binary file not shown.
Loading