Skip to content

Commit

Permalink
Wild test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Sep 15, 2024
1 parent fcdf2ea commit f181abd
Showing 1 changed file with 36 additions and 12 deletions.
48 changes: 36 additions & 12 deletions chiapos-2.0.6/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,42 @@ fn main() {

let blake3_include_path = dst.join("build").join("_deps").join("blake3-src").join("c");

println!(
"cargo:rustc-link-search=native={}",
dst.join("build").to_str().unwrap()
);
println!(
"cargo:rustc-link-search=native={}",
dst.join("build")
.join("_deps")
.join("blake3-build")
.to_str()
.unwrap()
);
// Detect platform: macOS vs. Windows
if cfg!(target_os = "windows") {
// Windows: Add `Release` or `Debug` subdirectory based on build type
let build_type = if cfg!(debug_assertions) {
"Debug"
} else {
"Release"
};
println!(
"cargo:rustc-link-search=native={}",
dst.join("build").join(build_type).to_str().unwrap()
);
println!(
"cargo:rustc-link-search=native={}",
dst.join("build")
.join("_deps")
.join("blake3-build")
.join(build_type)
.to_str()
.unwrap()
);
} else {
// macOS (or other platforms): Keep it as is
println!(
"cargo:rustc-link-search=native={}",
dst.join("build").to_str().unwrap()
);
println!(
"cargo:rustc-link-search=native={}",
dst.join("build")
.join("_deps")
.join("blake3-build")
.to_str()
.unwrap()
);
}

println!("cargo:rustc-link-lib=static=blake3");
println!("cargo:rustc-link-lib=static=chiapos_static");
Expand Down

0 comments on commit f181abd

Please sign in to comment.