@@ -97,14 +97,18 @@ fn pre_link_args(os: &'static str, arch: Arch, abi: &'static str) -> LinkArgs {
9797 _ => os. into ( ) ,
9898 } ;
9999
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 ( ) ;
108112
109113 let mut args = TargetOptions :: link_args (
110114 LinkerFlavor :: Darwin ( Cc :: No , Lld :: No ) ,
@@ -113,7 +117,7 @@ fn pre_link_args(os: &'static str, arch: Arch, abi: &'static str) -> LinkArgs {
113117 add_link_args_iter (
114118 & mut args,
115119 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 ( ) ,
117121 ) ;
118122 if abi != "macabi" {
119123 add_link_args (
@@ -268,11 +272,6 @@ fn macos_deployment_target(arch: Arch) -> (u32, u32) {
268272 . unwrap_or_else ( || macos_default_deployment_target ( arch) )
269273}
270274
271- fn macos_lld_platform_version ( arch : Arch ) -> String {
272- let ( major, minor) = macos_deployment_target ( arch) ;
273- format ! ( "{major}.{minor}" )
274- }
275-
276275pub fn macos_llvm_target ( arch : Arch ) -> String {
277276 let ( major, minor) = macos_deployment_target ( arch) ;
278277 format ! ( "{}-apple-macosx{}.{}.0" , arch. target_name( ) , major, minor)
@@ -339,11 +338,6 @@ pub fn mac_catalyst_llvm_target(arch: Arch) -> String {
339338 format ! ( "{}-apple-ios{}.{}.0-macabi" , arch. target_name( ) , major, minor)
340339}
341340
342- fn ios_lld_platform_version ( arch : Arch ) -> String {
343- let ( major, minor) = ios_deployment_target ( arch) ;
344- format ! ( "{major}.{minor}" )
345- }
346-
347341pub fn ios_sim_llvm_target ( arch : Arch ) -> String {
348342 let ( major, minor) = ios_deployment_target ( arch) ;
349343 format ! ( "{}-apple-ios{}.{}.0-simulator" , arch. target_name( ) , major, minor)
@@ -354,11 +348,6 @@ fn tvos_deployment_target() -> (u32, u32) {
354348 from_set_deployment_target ( "TVOS_DEPLOYMENT_TARGET" ) . unwrap_or ( ( 10 , 0 ) )
355349}
356350
357- fn tvos_lld_platform_version ( ) -> String {
358- let ( major, minor) = tvos_deployment_target ( ) ;
359- format ! ( "{major}.{minor}" )
360- }
361-
362351pub fn tvos_llvm_target ( arch : Arch ) -> String {
363352 let ( major, minor) = tvos_deployment_target ( ) ;
364353 format ! ( "{}-apple-tvos{}.{}.0" , arch. target_name( ) , major, minor)
@@ -374,11 +363,6 @@ fn watchos_deployment_target() -> (u32, u32) {
374363 from_set_deployment_target ( "WATCHOS_DEPLOYMENT_TARGET" ) . unwrap_or ( ( 5 , 0 ) )
375364}
376365
377- fn watchos_lld_platform_version ( ) -> String {
378- let ( major, minor) = watchos_deployment_target ( ) ;
379- format ! ( "{major}.{minor}" )
380- }
381-
382366pub fn watchos_sim_llvm_target ( arch : Arch ) -> String {
383367 let ( major, minor) = watchos_deployment_target ( ) ;
384368 format ! ( "{}-apple-watchos{}.{}.0-simulator" , arch. target_name( ) , major, minor)
0 commit comments