Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use cargo-ndk as a RUSTC_WRAPPER to pass --target to Clang
This is an alternative workaround for bbqsrc#92 that's similar to the solution used in ndk-build except that the `-Clink-arg rustflag` is injected via a RUSTC_WRAPPER instead of trying to modify CARGO_ENCODED_RUSTFLAGS. It turned out to be practically impossible to be able to reliably set CARGO_ENCODED_RUSTFLAGS without risking trampling over rustflags that might be configured via Cargo (for example `target.<cfg>.rustflags` are especially difficult to read outside of cargo itself) This approach avoids hitting the command line length limitations of the current workaround and avoids needing temporary hard links or copying the cargo-ndk binary to the target/ directory. Even though we've only seen quoting issues with the Windows `.cmd` wrappers this change to avoid using the wrapper scripts is being applied consistently for all platforms. E.g. considering the upstream recommendation to avoid the wrapper scripts if possible: https://android-review.googlesource.com/c/platform/ndk/+/2134712 Fixes: bbqsrc#92 Fixes: bbqsrc#104 Addresses: android/ndk#1856
- Loading branch information