Skip to content

Commit

Permalink
fix: not linking dylib to ios
Browse files Browse the repository at this point in the history
  • Loading branch information
vivianjeng committed Feb 26, 2025
1 parent e325ebd commit 0ef167f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ fn main() {
);

println!("cargo:rustc-link-lib=static=rapidsnark");
println!("cargo:rustc-link-lib=dylib=rapidsnark");
println!("cargo:rustc-link-lib={}", cpp_stdlib);
if target.contains("android") {
// pthread is included in libc in android
Expand All @@ -60,9 +59,13 @@ fn main() {
println!("cargo:rustc-link-lib=static=fr");
println!("cargo:rustc-link-lib=static=fq");
println!("cargo:rustc-link-lib=static=gmp");
println!("cargo:rustc-link-lib=dylib=fr");
println!("cargo:rustc-link-lib=dylib=fq");
println!("cargo:rustc-link-lib=dylib=gmp");

if !env::var("CARGO_CFG_TARGET_OS").unwrap().contains("ios") {
println!("cargo:rustc-link-lib=dylib=rapidsnark");
println!("cargo:rustc-link-lib=dylib=fr");
println!("cargo:rustc-link-lib=dylib=fq");
println!("cargo:rustc-link-lib=dylib=gmp");
}

// refer to https://github.com/bbqsrc/cargo-ndk to see how to link the libc++_shared.so file in Android
if env::var("CARGO_CFG_TARGET_OS").unwrap() == "android" {
Expand Down

0 comments on commit 0ef167f

Please sign in to comment.