Skip to content

Commit

Permalink
build: add workaround for android compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
badicsalex committed Jul 24, 2023
1 parent fa2fdf6 commit e0c0224
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ fn build_g2o() -> PathBuf {
std::fs::canonicalize("eigen").unwrap(),
);

println!("cargo:rerun-if-env-changed=ANDROID_NDK");
if let Ok(ndk) = std::env::var("ANDROID_NDK") {
dst.define("CMAKE_SYSTEM_NAME", "Android");
dst.define("ANDROID_NDK", ndk);
}

let dst = dst.build();
let lib_path = dst.join("lib");
println!("cargo:rustc-link-search=native={}", lib_path.display());
Expand Down

0 comments on commit e0c0224

Please sign in to comment.