Skip to content

Commit

Permalink
fix: get pthread from libc in android
Browse files Browse the repository at this point in the history
  • Loading branch information
chancehudson committed Jan 22, 2025
1 parent bc05e96 commit 80ac3ca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mopro-ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn link_rapidsnark() {
let manifest_dir = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
let rapidsnark_dir = manifest_dir.join("rapidsnark");
let absolute_lib_path = if rapidsnark_dir.join(&target).exists() {
rapidsnark_dir.join(target)
rapidsnark_dir.join(&target)
} else {
rapidsnark_dir.join(arch)
};
Expand Down Expand Up @@ -49,7 +49,12 @@ fn link_rapidsnark() {

println!("cargo:rustc-link-lib=static=rapidsnark");
println!("cargo:rustc-link-lib={}", cpp_stdlib);
println!("cargo:rustc-link-lib=pthread");
if target.contains("android") {
// pthread is included in libc in android
println!("cargo:rustc-link-lib=c");
} else {
println!("cargo:rustc-link-lib=pthread");
}
println!("cargo:rustc-link-lib=static=fr");
println!("cargo:rustc-link-lib=static=fq");
println!("cargo:rustc-link-lib=static=gmp");
Expand Down

0 comments on commit 80ac3ca

Please sign in to comment.