Skip to content

Commit

Permalink
Workaround for forced paths in openvr CMakeLists.txt.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgeek committed Jan 30, 2025
1 parent ebca3aa commit 5b4ca86
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openvr_sys"
version = "2.1.0"
version = "2.1.1"
edition = "2021"
rust-version = "1.82.0"
authors = [
Expand Down
13 changes: 12 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@ fn main() {
let target_pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap();

// Configure cmake to place build output in OUT_DIR
let out_dir_str = out_dir.to_string_lossy().into_owned();
let mut config = cmake::Config::new("openvr");
config.out_dir(&out_dir);
let config = config
.define("CMAKE_LIBRARY_OUTPUT_DIRECTORY", &out_dir_str)
.define("CMAKE_ARCHIVE_OUTPUT_DIRECTORY", &out_dir_str)
.define("CMAKE_RUNTIME_OUTPUT_DIRECTORY", &out_dir_str)
.define("CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG", &out_dir_str)
.define("CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE", &out_dir_str)
.define("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG", &out_dir_str)
.define("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE", &out_dir_str)
.define("CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG", &out_dir_str)
.define("CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE", &out_dir_str)
.out_dir(&out_dir);

if target_os == "macos" {
config.define("BUILD_UNIVERSAL", "OFF");
Expand Down

0 comments on commit 5b4ca86

Please sign in to comment.