@@ -1832,8 +1832,8 @@ impl Build {
1832
1832
if let Some ( arch) =
1833
1833
map_darwin_target_from_rust_to_compiler_architecture ( target)
1834
1834
{
1835
- let deployment_target = env :: var ( "IPHONEOS_DEPLOYMENT_TARGET" )
1836
- . unwrap_or_else ( |_| "7.0" . into ( ) ) ;
1835
+ let deployment_target =
1836
+ self . apple_deployment_version ( AppleOs :: Ios , target , None ) ;
1837
1837
cmd. args . push (
1838
1838
format ! (
1839
1839
"--target={}-apple-ios{}-simulator" ,
@@ -1846,8 +1846,8 @@ impl Build {
1846
1846
if let Some ( arch) =
1847
1847
map_darwin_target_from_rust_to_compiler_architecture ( target)
1848
1848
{
1849
- let deployment_target = env :: var ( "WATCHOS_DEPLOYMENT_TARGET" )
1850
- . unwrap_or_else ( |_| "5.0" . into ( ) ) ;
1849
+ let deployment_target =
1850
+ self . apple_deployment_version ( AppleOs :: WatchOs , target , None ) ;
1851
1851
cmd. args . push (
1852
1852
format ! (
1853
1853
"--target={}-apple-watchos{}-simulator" ,
@@ -2450,7 +2450,7 @@ impl Build {
2450
2450
}
2451
2451
} ;
2452
2452
2453
- let min_version = self . apple_deployment_version ( os, & target, arch_str) ;
2453
+ let min_version = self . apple_deployment_version ( os, & target, Some ( arch_str) ) ;
2454
2454
let ( sdk_prefix, sim_prefix) = match os {
2455
2455
AppleOs :: MacOs => ( "macosx" , "" ) ,
2456
2456
AppleOs :: Ios => ( "iphone" , "ios-" ) ,
@@ -3404,7 +3404,12 @@ impl Build {
3404
3404
Ok ( ret)
3405
3405
}
3406
3406
3407
- fn apple_deployment_version ( & self , os : AppleOs , target : & str , arch_str : & str ) -> String {
3407
+ fn apple_deployment_version (
3408
+ & self ,
3409
+ os : AppleOs ,
3410
+ target : & str ,
3411
+ arch_str : Option < & str > ,
3412
+ ) -> String {
3408
3413
fn rustc_provided_target ( rustc : Option < & str > , target : & str ) -> Option < String > {
3409
3414
let rustc = rustc?;
3410
3415
let output = Command :: new ( rustc)
@@ -3438,7 +3443,7 @@ impl Build {
3438
3443
. ok ( )
3439
3444
. or_else ( || rustc_provided_target ( rustc, target) )
3440
3445
. unwrap_or_else ( || {
3441
- if arch_str == "aarch64" {
3446
+ if arch_str == Some ( "aarch64" ) {
3442
3447
"11.0"
3443
3448
} else {
3444
3449
"10.7"
@@ -3452,7 +3457,7 @@ impl Build {
3452
3457
AppleOs :: WatchOs => env:: var ( "WATCHOS_DEPLOYMENT_TARGET" )
3453
3458
. ok ( )
3454
3459
. or_else ( || rustc_provided_target ( rustc, target) )
3455
- . unwrap_or_else ( || "2 .0" . into ( ) ) ,
3460
+ . unwrap_or_else ( || "5 .0" . into ( ) ) ,
3456
3461
}
3457
3462
}
3458
3463
0 commit comments