Skip to content

Commit 1995b40

Browse files
committed
fix build.rs
1 parent 89baca9 commit 1995b40

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

rust_bindings/build.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::env;
2+
use std::fs;
23
use std::path::PathBuf;
34

45
use cmake::Config;
@@ -27,8 +28,14 @@ fn main() {
2728
.define("BUILD_CHIAVDFC", "ON")
2829
.env("BUILD_VDF_CLIENT", "N")
2930
.define("BUILD_PYTHON", "OFF")
30-
.define("HARDENING", if is_fuzzing || is_debug_build { "ON" } else { "OFF" })
31-
.very_verbose(true)
31+
.define(
32+
"HARDENING",
33+
if is_fuzzing || is_debug_build {
34+
"ON"
35+
} else {
36+
"OFF"
37+
},
38+
)
3239
.build();
3340

3441
println!("cargo:rustc-link-lib=static=chiavdfc");
@@ -55,7 +62,12 @@ fn main() {
5562
);
5663
} else if cfg!(target_os = "macos") {
5764
println!("cargo:rustc-link-lib=static=gmp");
58-
println!("cargo:rustc-link-search=native=/opt/homebrew/lib");
65+
let homebrew_path = if fs::metadata("/opt/homebrew").is_ok() {
66+
"/opt/homebrew/lib"
67+
} else {
68+
"/usr/local/lib"
69+
};
70+
println!("cargo:rustc-link-search=native={homebrew_path}");
5971
} else {
6072
println!("cargo:rustc-link-lib=gmp");
6173
}

0 commit comments

Comments
 (0)