Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
AtomicGamer9523 committed Nov 24, 2023
1 parent a18935f commit ee39247
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/l2math/bindings/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::path::{Path, PathBuf};
type Res<T = (), E = Box<dyn std::error::Error>> = Result<T, E>;

fn main() -> Res {
if env::var("CARGO_CFG_TARGET_OS").unwrap() == "android" {
if env::var("CARGO_CFG_TARGET_OS")? == "android" {
android()?;
};
Ok(())
Expand All @@ -14,11 +14,15 @@ fn android() -> Res {
println!("cargo:rustc-link-lib=c++_shared");

let output_path = env::var("CARGO_NDK_OUTPUT_PATH")?;
println!("output_path: {}", &output_path);
let ndk_sysroot_libs_path =
env::var_os("CARGO_NDK_SYSROOT_LIBS_PATH").ok_or("CARGO_NDK_SYSROOT_LIBS_PATH not set")?;
println!("ndk_sysroot_libs_path: {:?}", &ndk_sysroot_libs_path);
let sysroot_libs_path: PathBuf = ndk_sysroot_libs_path.into();
let lib_path = sysroot_libs_path.join("libc++_shared.so");
println!("lib_path: {:?}", &lib_path);
let new_lib_path = Path::new(&output_path).join("libc++_shared.so");
println!("new_lib_path: {:?}", &new_lib_path);
std::fs::copy(lib_path, new_lib_path)?;
Ok(())
}

0 comments on commit ee39247

Please sign in to comment.