@@ -97,14 +97,18 @@ fn pre_link_args(os: &'static str, arch: Arch, abi: &'static str) -> LinkArgs {
97
97
_ => os. into ( ) ,
98
98
} ;
99
99
100
- let platform_version: StaticCow < str > = match os {
101
- "ios" => ios_lld_platform_version ( arch) ,
102
- "tvos" => tvos_lld_platform_version ( ) ,
103
- "watchos" => watchos_lld_platform_version ( ) ,
104
- "macos" => macos_lld_platform_version ( arch) ,
105
- _ => unreachable ! ( ) ,
106
- }
107
- . into ( ) ;
100
+ let min_version: StaticCow < str > = {
101
+ let ( major, minor) = match ( os, abi) {
102
+ ( "ios" , "macabi" ) => mac_catalyst_deployment_target ( ) ,
103
+ ( "ios" , _) => ios_deployment_target ( arch) ,
104
+ ( "tvos" , _) => tvos_deployment_target ( ) ,
105
+ ( "watchos" , _) => watchos_deployment_target ( ) ,
106
+ ( "macos" , _) => macos_deployment_target ( arch) ,
107
+ _ => unreachable ! ( ) ,
108
+ } ;
109
+ format ! ( "{major}.{minor}" ) . into ( )
110
+ } ;
111
+ let sdk_version = min_version. clone ( ) ;
108
112
109
113
let mut args = TargetOptions :: link_args (
110
114
LinkerFlavor :: Darwin ( Cc :: No , Lld :: No ) ,
@@ -113,7 +117,7 @@ fn pre_link_args(os: &'static str, arch: Arch, abi: &'static str) -> LinkArgs {
113
117
add_link_args_iter (
114
118
& mut args,
115
119
LinkerFlavor :: Darwin ( Cc :: No , Lld :: No ) ,
116
- [ platform_name, platform_version . clone ( ) , platform_version ] . into_iter ( ) ,
120
+ [ platform_name, min_version , sdk_version ] . into_iter ( ) ,
117
121
) ;
118
122
if abi != "macabi" {
119
123
add_link_args (
@@ -268,11 +272,6 @@ fn macos_deployment_target(arch: Arch) -> (u32, u32) {
268
272
. unwrap_or_else ( || macos_default_deployment_target ( arch) )
269
273
}
270
274
271
- fn macos_lld_platform_version ( arch : Arch ) -> String {
272
- let ( major, minor) = macos_deployment_target ( arch) ;
273
- format ! ( "{major}.{minor}" )
274
- }
275
-
276
275
pub fn macos_llvm_target ( arch : Arch ) -> String {
277
276
let ( major, minor) = macos_deployment_target ( arch) ;
278
277
format ! ( "{}-apple-macosx{}.{}.0" , arch. target_name( ) , major, minor)
@@ -339,11 +338,6 @@ pub fn mac_catalyst_llvm_target(arch: Arch) -> String {
339
338
format ! ( "{}-apple-ios{}.{}.0-macabi" , arch. target_name( ) , major, minor)
340
339
}
341
340
342
- fn ios_lld_platform_version ( arch : Arch ) -> String {
343
- let ( major, minor) = ios_deployment_target ( arch) ;
344
- format ! ( "{major}.{minor}" )
345
- }
346
-
347
341
pub fn ios_sim_llvm_target ( arch : Arch ) -> String {
348
342
let ( major, minor) = ios_deployment_target ( arch) ;
349
343
format ! ( "{}-apple-ios{}.{}.0-simulator" , arch. target_name( ) , major, minor)
@@ -354,11 +348,6 @@ fn tvos_deployment_target() -> (u32, u32) {
354
348
from_set_deployment_target ( "TVOS_DEPLOYMENT_TARGET" ) . unwrap_or ( ( 10 , 0 ) )
355
349
}
356
350
357
- fn tvos_lld_platform_version ( ) -> String {
358
- let ( major, minor) = tvos_deployment_target ( ) ;
359
- format ! ( "{major}.{minor}" )
360
- }
361
-
362
351
pub fn tvos_llvm_target ( arch : Arch ) -> String {
363
352
let ( major, minor) = tvos_deployment_target ( ) ;
364
353
format ! ( "{}-apple-tvos{}.{}.0" , arch. target_name( ) , major, minor)
@@ -374,11 +363,6 @@ fn watchos_deployment_target() -> (u32, u32) {
374
363
from_set_deployment_target ( "WATCHOS_DEPLOYMENT_TARGET" ) . unwrap_or ( ( 5 , 0 ) )
375
364
}
376
365
377
- fn watchos_lld_platform_version ( ) -> String {
378
- let ( major, minor) = watchos_deployment_target ( ) ;
379
- format ! ( "{major}.{minor}" )
380
- }
381
-
382
366
pub fn watchos_sim_llvm_target ( arch : Arch ) -> String {
383
367
let ( major, minor) = watchos_deployment_target ( ) ;
384
368
format ! ( "{}-apple-watchos{}.{}.0-simulator" , arch. target_name( ) , major, minor)
0 commit comments