Skip to content

Commit

Permalink
Link c++ appropriately for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
n8henrie committed Jan 27, 2024
1 parent a045993 commit 07a62e6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion taskwarrior-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ fn main() {
println!("cargo:rustc-link-lib=static=libshared");
println!("cargo:rustc-link-lib=static=columns");
println!("cargo:rustc-link-lib=static=commands");
println!("cargo:rustc-link-lib=c++");

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(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");
Expand Down

0 comments on commit 07a62e6

Please sign in to comment.