Skip to content

Commit

Permalink
minimap2-sys compile on android using
Browse files Browse the repository at this point in the history
Works with cross build --target aarch64-linux-android

Initial work on #66
  • Loading branch information
jguhlin committed Aug 7, 2024
1 parent 6299e62 commit fc20108
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ simdutf8 = {version = "0.1", optional = true}
needletail = { version = "0.5", optional = true, default-features = false}

# Dep for development
# minimap2-sys = { path = "./minimap2-sys" }
minimap2-sys = "0.1.19"
minimap2-sys = { path = "./minimap2-sys" }
# minimap2-sys = "0.1.19"
rust-htslib = { version = "0.47", default-features = false, optional = true }

[dev-dependencies]
Expand Down
11 changes: 8 additions & 3 deletions minimap2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ fn compile() {

println!("cargo:rustc-link-lib=m");

println!("cargo:rustc-link-lib=pthread");
if !env::var("TARGET").unwrap().contains("android") {
println!("cargo:rustc-link-lib=pthread");
}

let mut cc = cc::Build::new();

Expand All @@ -134,7 +136,10 @@ fn compile() {

cc.flag("-DHAVE_KALLOC");
cc.flag("-lm");
cc.flag("-lpthread");

if !env::var("TARGET").unwrap().contains("android") {
cc.flag("-lpthread");
}

#[cfg(feature = "static")]
cc.static_flag(true);
Expand Down Expand Up @@ -193,7 +198,7 @@ fn gen_bindings() {
#[cfg(not(feature = "bindgen"))]
fn gen_bindings() {}

fn main() {
fn main() {
compile();
gen_bindings();
}

0 comments on commit fc20108

Please sign in to comment.