bbqsrc / cargo-ndk

Compile Rust projects against the Android NDK without hassle
Apache License 2.0
712 stars 64 forks source link

Need to set extra environment variables when cross-compiling `rust-bindgen` #148

Closed Xerxes-2 closed 2 months ago

Xerxes-2 commented 2 months ago

My crate failed to cross-compile rustls after it introduced aws-lc-rs. After spending some time digging into it, I found the failure is caused by rust-bindgen, and two extra env vars should be set to make it compile.

ANDROID_NDK=/path/to/android/ndk and BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/path/to/andtroid/ndk/sysroot"

bbqsrc commented 2 months ago

Bindgen flag and environment variables as required.