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 _LINKER wrapper to pass --target to Clang
This is an alternative workaround for #92 that's similar to the solution used in ndk-build except that the `--target=<triple><api-level>` argument for Clang is injected by using cargo-ndk as a linker 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: #92 Fixes: #104 Addresses: android/ndk#1856
- Loading branch information