Skip to content

Commit

Permalink
allow build.rs to be skipped
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
LegitCamper committed Sep 27, 2024
1 parent a14143a commit 8c64227
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ webkit = ["ultralight"]
ultralight = ["ul-next"]
native-tls = ["reqwest/native-tls"]
rustls-tls = ["reqwest/rustls-tls"]
# exists to prevent build.rs from failing build
cross = []

[dependencies]
env_home = "0.1.0"
Expand Down
30 changes: 15 additions & 15 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ use std::fs::{self, DirEntry};
use std::path::Path;

fn main() {
let out = var("OUT_DIR").unwrap();
// This allows it to work in this project but also other projects too
let path = Path::new(&out)
.parent()
.unwrap()
.parent()
.unwrap()
.parent()
.unwrap()
.parent()
.unwrap()
.parent()
.unwrap();

// ensure runtime resources exist
#[cfg(feature = "ultralight")]
#[cfg(not(feature = "cross"))]
{
let out = var("OUT_DIR").unwrap();
// This allows it to work in this project but also other projects too
let path = Path::new(&out)
.parent()
.unwrap()
.parent()
.unwrap()
.parent()
.unwrap()
.parent()
.unwrap()
.parent()
.unwrap();

let mut possible_directories = Vec::new();

let target = Path::new(path).join("target");
Expand Down Expand Up @@ -73,7 +74,6 @@ fn main() {
}
}

println!("cargo:rerun-if-changed=targets");
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=Cargo.lock");
}
Expand Down

0 comments on commit 8c64227

Please sign in to comment.