bbqsrc / cargo-ndk

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

Feature Request: Set Env for clang/cc-rs #131

Closed Fancy2209 closed 7 months ago

Fancy2209 commented 7 months ago

Ruffle-Android fails to build with the jpegxr feature on, this is due to the crate using C++ code compiled with the cc crate. This is due to the include used beeing set to /usr/include instead of the NDK Sysroot. Is there any chance the env for Clang could be set to prevent this? If this isn't related to cargo-ndk, I'm sorry for bothering.

See: Output without setting the compiler in jpegxr's build.rs https://github.com/torokati44/ruffle-android-fork/actions/runs/8660976443/job/23749950385

Output when setting the compiler in jpegxr's build.rs https://github.com/Fancy2209/ruffle-android/actions/runs/8661894376/job/23752764570

bbqsrc commented 7 months ago

Have you tried with the --bindgen flag?

Fancy2209 commented 7 months ago

I have not Am I supposed to add it to the cargo NDK command or clang?

Fancy2209 commented 7 months ago

it was for cargo ndk, completely missed it! that works, thanks