Skip to content

Commit 1a4194f

Browse files
fix: missing libvpl.dll causes driver_alvr_server to crash (#3156)
1 parent 65ea5b1 commit 1a4194f

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

alvr/server_openvr/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn main() {
114114

115115
build.define("ONEVPL_EXPERIMENTAL", None);
116116
build.include(vpl_include_path);
117-
println!("cargo:rustc-link-lib=static=vpl");
117+
println!("cargo:rustc-link-lib=vpl");
118118
}
119119

120120
build.compile("bindings");

alvr/xtask/src/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ pub fn build_streamer(
199199
sh.copy_file(lib_path.clone(), bin_dir).unwrap();
200200
}
201201
}
202+
203+
// copy libvpl.dll
204+
sh.copy_file(
205+
afs::deps_dir().join("windows/libvpl/alvr_build/bin/libvpl.dll"),
206+
build_layout.openvr_driver_lib_dir(),
207+
)
208+
.unwrap();
202209
} else if cfg!(target_os = "linux") {
203210
// build compositor wrapper
204211
let _push_guard = sh.push_dir(afs::crate_dir("vrcompositor_wrapper"));

alvr/xtask/src/dependencies.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,12 @@ fn prepare_libvpl_windows(deps_path: &Path) {
9292
let install_prefix = final_path.join("alvr_build");
9393
let _push_guard = sh.push_dir(final_path);
9494

95-
cmd!(sh, "cmake -B build -DCMAKE_INSTALL_PREFIX={install_prefix}")
96-
.run()
97-
.unwrap();
95+
cmd!(
96+
sh,
97+
"cmake -B build -DUSE_MSVC_STATIC_RUNTIME=ON -DCMAKE_INSTALL_PREFIX={install_prefix}"
98+
)
99+
.run()
100+
.unwrap();
98101
cmd!(sh, "cmake --build build --config Release")
99102
.run()
100103
.unwrap();

alvr/xtask/src/packaging.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ pub fn include_licenses(root_path: &Path, gpl: bool) {
5151
)
5252
.ok();
5353
}
54+
if cfg!(windows) {
55+
sh.copy_file(
56+
afs::deps_dir().join("windows/libvpl/alvr_build/share/vpl/licensing/license.txt"),
57+
licenses_dir.join("libvpl.txt"),
58+
)
59+
.unwrap();
60+
}
5461

5562
let licenses_content = generate_licenses();
5663
sh.write_file(licenses_dir.join("dependencies.html"), licenses_content)

0 commit comments

Comments
 (0)