Fix detect_targets_linux: Detect arch/libc at runtime using guess_host_triple (#649)

- Enable `guess_host_triple` on all targets
 - Fix `detect_targets_linux`: Detect runtime arch/libc using
   `guess_host_triple` instead of using the one specified in `TARGET`.
 - Add support for android in `detect_targets`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2023-01-04 12:32:13 +11:00 committed by GitHub
parent 49f60d37fe
commit 42672ccf40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 58 deletions

View file

@ -42,6 +42,8 @@ pub async fn detect_targets() -> Vec<String> {
if targets[0].contains("gnu") {
targets.push(targets[0].replace("gnu", "musl"));
} else if targets[0].contains("android") {
targets.push(targets[0].replace("android", "musl"));
}
targets