Fix windows target detection for abi gnullvm

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-07-01 19:34:52 +10:00
parent ec6f81935c
commit 8e58398f57
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -220,9 +220,10 @@ mod windows {
use guess_host_triple::guess_host_triple;
pub(super) fn detect_alternative_targets(target: &str) -> Option<String> {
target
.contains("gnu")
.then(|| target.replace("gnu", "msvc"))
let (prefix, abi) = target.rsplit_once('-').expect("Invalid target triple");
// detect abi in ["gnu", "gnullvm", ...]
(abi != "msvc").then(|| format!("{prefix}-msvc"))
}
pub(super) fn detect_targets_windows() -> Vec<String> {