Skip to content

Commit b80e0b7

Browse files
committed
Reorder tvos_* functions in apple_base.rs to avoid breaking sorted order
1 parent a3f5566 commit b80e0b7

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

compiler/rustc_target/src/spec/apple_base.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ fn link_env_remove(arch: Arch, os: &'static str) -> StaticCow<[StaticCow<str>]>
244244
|| sdkroot.contains("iPhoneSimulator.platform")
245245
|| sdkroot.contains("AppleTVOS.platform")
246246
|| sdkroot.contains("AppleTVSimulator.platform")
247+
|| sdkroot.contains("WatchOS.platform")
248+
|| sdkroot.contains("WatchSimulator.platform")
247249
{
248250
env_remove.push("SDKROOT".into())
249251
}
@@ -283,16 +285,6 @@ pub fn ios_llvm_target(arch: Arch) -> String {
283285
format!("{}-apple-ios{}.{}.0", arch.target_name(), major, minor)
284286
}
285287

286-
pub fn tvos_sim_llvm_target(arch: Arch) -> String {
287-
let (major, minor) = tvos_deployment_target();
288-
format!("{}-apple-tvos{}.{}.0-simulator", arch.target_name(), major, minor)
289-
}
290-
291-
pub fn tvos_llvm_target(arch: Arch) -> String {
292-
let (major, minor) = tvos_deployment_target();
293-
format!("{}-apple-tvos{}.{}.0", arch.target_name(), major, minor)
294-
}
295-
296288
fn ios_lld_platform_version() -> String {
297289
let (major, minor) = ios_deployment_target();
298290
format!("{major}.{minor}")
@@ -313,6 +305,16 @@ fn tvos_lld_platform_version() -> String {
313305
format!("{major}.{minor}")
314306
}
315307

308+
pub fn tvos_llvm_target(arch: Arch) -> String {
309+
let (major, minor) = tvos_deployment_target();
310+
format!("{}-apple-tvos{}.{}.0", arch.target_name(), major, minor)
311+
}
312+
313+
pub fn tvos_sim_llvm_target(arch: Arch) -> String {
314+
let (major, minor) = tvos_deployment_target();
315+
format!("{}-apple-tvos{}.{}.0-simulator", arch.target_name(), major, minor)
316+
}
317+
316318
fn watchos_deployment_target() -> (u32, u32) {
317319
// If you are looking for the default deployment target, prefer `rustc --print deployment-target`.
318320
from_set_deployment_target("WATCHOS_DEPLOYMENT_TARGET").unwrap_or((5, 0))

0 commit comments

Comments
 (0)