mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 17:03:35 +00:00
Fix incorrect 'llvm_target' value used on watchOS target
The expected value is "<arch>-apple-watchos<major>.<minor>.0", i.e. "arm64_32-apple-watchos8.0.0". compiler/rustc_target/src/spec/base/apple/mod.rs contains functions that construct such string. There is an existing function `watchos_sim_llvm_target` which returns llvm target value for watchOS simulator. But there is none for watchOS device. This commit adds that missing function to align watchOS with other Apple platform targets.
This commit is contained in:
parent
b4acbe4233
commit
1ffb410aa2
@ -359,6 +359,11 @@ fn watchos_deployment_target() -> (u32, u32) {
|
||||
from_set_deployment_target("WATCHOS_DEPLOYMENT_TARGET").unwrap_or((5, 0))
|
||||
}
|
||||
|
||||
pub fn watchos_llvm_target(arch: Arch) -> String {
|
||||
let (major, minor) = watchos_deployment_target();
|
||||
format!("{}-apple-watchos{}.{}.0", arch.target_name(), major, minor)
|
||||
}
|
||||
|
||||
pub fn watchos_sim_llvm_target(arch: Arch) -> String {
|
||||
let (major, minor) = watchos_deployment_target();
|
||||
format!("{}-apple-watchos{}.{}.0-simulator", arch.target_name(), major, minor)
|
||||
|
@ -1,10 +1,11 @@
|
||||
use crate::spec::base::apple::{opts, Arch};
|
||||
use crate::spec::base::apple::{opts, watchos_llvm_target, Arch};
|
||||
use crate::spec::{Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let base = opts("watchos", Arch::Arm64_32);
|
||||
let arch = Arch::Arm64_32;
|
||||
let base = opts("watchos", arch);
|
||||
Target {
|
||||
llvm_target: "arm64_32-apple-watchos".into(),
|
||||
llvm_target: watchos_llvm_target(arch).into(),
|
||||
metadata: crate::spec::TargetMetadata {
|
||||
description: None,
|
||||
tier: None,
|
||||
|
Loading…
Reference in New Issue
Block a user