Skip to content

Commit fb0bd80

Browse files
authored
Update to 1.0.10 (#4)
* Update to OpenVR SDK 1.0.7 This also switches to using OpenVR as a submodule. * Build OpenVR client lib from source and statically link * Tweak bindings * Work around apparently broken cmake build on windows * Fix linking on windows * Update to OpenVR SDK 1.0.8 * Less absurd enum names * Update to OpenVR 1.0.10, bump version * Work around yet another negligent upstream ABI breakage case
1 parent 2a2d4bf commit fb0bd80

29 files changed

+8133
-17251
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "openvr"]
2+
path = openvr
3+
url = https://github.com/ValveSoftware/openvr.git

Cargo.toml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
[package]
22
name = "openvr_sys"
3-
version = "1.0.1"
3+
version = "2.0.0"
44
authors = [
55
"Colin Sherratt",
66
"Erick Tryzelaar",
7-
"Rene Eichhorn"
7+
"Rene Eichhorn",
8+
"Benjamin Saunders"
89
]
910
license = "MIT"
1011
description = "Raw unsafe system binding for openvr"
1112
repository = "https://github.com/rust-openvr/rust-openvr-sys"
12-
13+
exclude = [
14+
"openvr/samples/*",
15+
"openvr/bin/*",
16+
"openvr/lib/*",
17+
"openvr/controller_callouts/*",
18+
]
1319
build = "build.rs"
1420

21+
[build-dependencies]
22+
cmake = "0.1"
23+
1524
[lib]
1625
name = "openvr_sys"
1726
path = "lib.rs"

bindings.rs

Lines changed: 8065 additions & 0 deletions
Large diffs are not rendered by default.

build.rs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
#[cfg(target_os="macos")]
2-
fn main() {
3-
println!("cargo:rustc-link-search={}/openvr/lib/osx32", env!("CARGO_MANIFEST_DIR"));
4-
println!("cargo:rustc-link-search={}/openvr/bin/osx32", env!("CARGO_MANIFEST_DIR"));
5-
}
1+
extern crate cmake;
62

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

13-
#[cfg(target_os="windows")]
14-
fn main() {
15-
println!("cargo:rustc-link-search={}/openvr/lib/win64", env!("CARGO_MANIFEST_DIR"));
16-
println!("cargo:rustc-link-search={}/openvr/bin/win64", env!("CARGO_MANIFEST_DIR"));
6+
// Work around broken cmake build
7+
#[cfg(windows)]
8+
cfg.cxxflag("/DWIN32");
9+
10+
let dst = cfg.build();
11+
println!("cargo:rustc-link-search=native={}/lib", dst.display());
12+
13+
#[cfg(all(windows, target_pointer_width = "64"))]
14+
println!("cargo:rustc-link-lib=static=openvr_api64");
15+
16+
#[cfg(not(all(windows, target_pointer_width = "64")))]
17+
println!("cargo:rustc-link-lib=static=openvr_api");
18+
19+
#[cfg(target_os="linux")]
20+
println!("cargo:rustc-link-lib=stdc++");
1721
}

0 commit comments

Comments
 (0)