Explicitly link to libomp on MacOS

This commit is contained in:
arizhih 2024-10-14 15:28:28 +02:00
parent bcd94d1fcb
commit 4913e20b5d

View file

@ -92,6 +92,9 @@ fn main() {
{ {
if target.contains("gnu") { if target.contains("gnu") {
println!("cargo:rustc-link-lib=gomp"); println!("cargo:rustc-link-lib=gomp");
} else if target.contains("apple") {
println!("cargo:rustc-link-lib=omp");
println!("cargo:rustc-link-search=/opt/homebrew/opt/libomp/lib");
} }
} }
@ -232,7 +235,7 @@ fn main() {
let destination = config.build(); let destination = config.build();
add_link_search_path(&out.join("lib")).unwrap(); add_link_search_path(&out.join("build")).unwrap();
println!("cargo:rustc-link-search=native={}", destination.display()); println!("cargo:rustc-link-search=native={}", destination.display());
println!("cargo:rustc-link-lib=static=whisper"); println!("cargo:rustc-link-lib=static=whisper");