Skip to content

Commit

Permalink
Fix uuid linking on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
n8henrie committed Jan 27, 2024
1 parent 89d797e commit e722ac4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions taskwarrior-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,21 @@ fn main() {

let target_os = env::var("CARGO_CFG_TARGET_OS");
match target_os.as_deref() {
Ok("linux") => println!("cargo:rustc-link-lib=stdc++"),
Ok("macos") => println!("cargo:rustc-link-lib=c++"),
Ok("linux") => {
println!("cargo:rustc-link-lib=stdc++");
println!("cargo:rustc-link-lib=dylib=uuid");
}
Ok("macos") => {
println!("cargo:rustc-link-lib=c++");
println!(
"cargo:rustc-link-search=native=/opt/homebrew/opt/gnutls/lib"
);
}
Ok(target) => panic!("not sure how to link on {target}"),
Err(e) => panic!("Not able to determine target due to {e}"),
}

println!("cargo:rustc-link-search=native=/opt/homebrew/opt/gnutls/lib");
println!("cargo:rustc-link-lib=dylib=gnutls");
println!("cargo:rustc-link-lib=dylib=uuid");

let bindings = bindgen::Builder::default()
.header("wrapper.h")
Expand Down

0 comments on commit e722ac4

Please sign in to comment.