@@ -1718,8 +1718,8 @@ impl Build {
1718
1718
if let Some ( arch) =
1719
1719
map_darwin_target_from_rust_to_compiler_architecture ( target)
1720
1720
{
1721
- let deployment_target = env :: var ( "IPHONEOS_DEPLOYMENT_TARGET" )
1722
- . unwrap_or_else ( |_| "7.0" . into ( ) ) ;
1721
+ let deployment_target =
1722
+ self . apple_deployment_version ( AppleOs :: Ios , target , None ) ;
1723
1723
cmd. args . push (
1724
1724
format ! (
1725
1725
"--target={}-apple-ios{}-simulator" ,
@@ -1732,8 +1732,8 @@ impl Build {
1732
1732
if let Some ( arch) =
1733
1733
map_darwin_target_from_rust_to_compiler_architecture ( target)
1734
1734
{
1735
- let deployment_target = env :: var ( "WATCHOS_DEPLOYMENT_TARGET" )
1736
- . unwrap_or_else ( |_| "5.0" . into ( ) ) ;
1735
+ let deployment_target =
1736
+ self . apple_deployment_version ( AppleOs :: WatchOs , target , None ) ;
1737
1737
cmd. args . push (
1738
1738
format ! (
1739
1739
"--target={}-apple-watchos{}-simulator" ,
@@ -2336,7 +2336,7 @@ impl Build {
2336
2336
}
2337
2337
} ;
2338
2338
2339
- let min_version = self . apple_deployment_version ( os, & target, arch_str) ;
2339
+ let min_version = self . apple_deployment_version ( os, & target, Some ( arch_str) ) ;
2340
2340
let ( sdk_prefix, sim_prefix) = match os {
2341
2341
AppleOs :: MacOs => ( "macosx" , "" ) ,
2342
2342
AppleOs :: Ios => ( "iphone" , "ios-" ) ,
@@ -3290,7 +3290,12 @@ impl Build {
3290
3290
Ok ( ret)
3291
3291
}
3292
3292
3293
- fn apple_deployment_version ( & self , os : AppleOs , target : & str , arch_str : & str ) -> String {
3293
+ fn apple_deployment_version (
3294
+ & self ,
3295
+ os : AppleOs ,
3296
+ target : & str ,
3297
+ arch_str : Option < & str > ,
3298
+ ) -> String {
3294
3299
fn rustc_provided_target ( rustc : Option < & str > , target : & str ) -> Option < String > {
3295
3300
let rustc = rustc?;
3296
3301
let output = Command :: new ( rustc)
@@ -3327,7 +3332,7 @@ impl Build {
3327
3332
. ok ( )
3328
3333
. or_else ( || rustc_provided_target ( rustc, target) )
3329
3334
. unwrap_or_else ( || {
3330
- if arch_str == "aarch64" {
3335
+ if arch_str == Some ( "aarch64" ) {
3331
3336
"11.0"
3332
3337
} else {
3333
3338
"10.7"
@@ -3341,7 +3346,7 @@ impl Build {
3341
3346
AppleOs :: WatchOs => env:: var ( "WATCHOS_DEPLOYMENT_TARGET" )
3342
3347
. ok ( )
3343
3348
. or_else ( || rustc_provided_target ( rustc, target) )
3344
- . unwrap_or_else ( || "2 .0" . into ( ) ) ,
3349
+ . unwrap_or_else ( || "5 .0" . into ( ) ) ,
3345
3350
}
3346
3351
}
3347
3352
0 commit comments