Skip to content

Commit

Permalink
Remove build-helper dependency (#18)
Browse files Browse the repository at this point in the history
The build-helper crate and repo has not been updated in 2 years and looks abandoned, and we have a long running PR for it (DanielKeep/rust-build-helper#2) with some dependency updates that haven't been merged in nor any communication about.

So let's just remove the dependency and use explicit Cargo env vars and prinln instructions instead, easy enough.
  • Loading branch information
repi authored Sep 14, 2019
1 parent 001075c commit 1548750
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
3 changes: 1 addition & 2 deletions physx-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "physx-sys"
description = "Unsafe bindings for NVIDIA PhysX C++ SDK"
version = "0.1.0+4.1"
version = "0.1.1+4.1"
authors = ["Embark <[email protected]>", "Tomasz Stachowiak <[email protected]>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/EmbarkStudios/physx-rs"
Expand Down Expand Up @@ -37,4 +37,3 @@ doctest = false
[build-dependencies]
cc = "1.0"
cmake = "0.1.35"
build-helper = "0.1.1"
27 changes: 14 additions & 13 deletions physx-sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
use cmake::Config;
use std::env;
use std::ffi::OsString;
use std::path::PathBuf;

#[cfg(debug_assertions)]
fn get_bin_dir() -> (&'static str, &'static str) {
match build_helper::target::triple().os() {
match env::var("CARGO_CFG_TARGET_OS").unwrap().as_str() {
"linux" => ("linux", "bin/linux.clang/debug"),
"windows" => ("windows", "bin/win.x86_64.vc141.md/debug"),
"darwin" => ("mac", "bin/mac.x86_64/debug"),
"macos" => ("mac", "bin/mac.x86_64/debug"),
p @ _ => panic!("Unsupported platform: {}", p),
}
}

#[cfg(not(debug_assertions))]
fn get_bin_dir() -> (&'static str, &'static str) {
match build_helper::target::triple().os() {
match env::var("CARGO_CFG_TARGET_OS").unwrap().as_str() {
"linux" => ("linux", "bin/linux.clang/profile"),
"windows" => ("windows", "bin/win.x86_64.vc141.md/profile"),
"darwin" => ("mac", "bin/mac.x86_64/profile"),
"macos" => ("mac", "bin/mac.x86_64/profile"),
p @ _ => panic!("Unsupported platform: {}", p),
}
}
Expand Down Expand Up @@ -54,8 +55,8 @@ fn main() {
);
env::set_var("PM_PATHS", env::var("PM_opengllinux_PATH").unwrap());

let output_dir_path = build_helper::out_dir();
let output_dir = output_dir_path.to_string_lossy().into_owned();
let output_dir = env::var("OUT_DIR").unwrap();
let output_dir_path: PathBuf = output_dir.clone().into();

let build_mode = if cfg!(debug_assertions) {
"debug"
Expand Down Expand Up @@ -172,13 +173,13 @@ fn main() {
.file("src/physx.cpp")
.compile("physx_api");

build_helper::rerun_if_changed("src/structgen/structgen.cpp");
build_helper::rerun_if_changed("src/structgen/structgen.hpp");
build_helper::rerun_if_changed("src/lib.rs");
build_helper::rerun_if_changed("src/physx_generated.hpp");
build_helper::rerun_if_changed("src/physx_generated.rs");
build_helper::rerun_if_changed("src/physx.cpp");
println!("cargo:rerun-if-changed=src/structgen/structgen.cpp");
println!("cargo:rerun-if-changed=src/structgen/structgen.hpp");
println!("cargo:rerun-if-changed=src/lib.rs");
println!("cargo:rerun-if-changed=src/physx_generated.hpp");
println!("cargo:rerun-if-changed=src/physx_generated.rs");
println!("cargo:rerun-if-changed=src/physx.cpp");

// TODO: use the cloned git revision number instead
build_helper::rerun_if_changed("PhysX/physx/include/PxPhysicsVersion.h");
println!("cargo:rerun-if-changed=PhysX/physx/include/PxPhysicsVersion.h");
}

0 comments on commit 1548750

Please sign in to comment.