diff --git a/Cargo.toml b/Cargo.toml index df352f3..06d3e0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/build.rs b/build.rs index 8389ee8..e8a76cc 100644 --- a/build.rs +++ b/build.rs @@ -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"); @@ -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"); }