@@ -54,24 +54,24 @@ pub fn macos_llvm_target(arch: &str) -> String {
54
54
55
55
pub fn sysroot ( sdk : & str ) -> Result < String , String > {
56
56
let actual_sdk_path = sdk_path ( sdk) ?;
57
- // Like Clang, allow the SDKROOT environment variable used by Xcode to define the sysroot
57
+ // Like Clang, allow the ` SDKROOT` environment variable used by Xcode to define the sysroot.
58
58
if let Some ( sdk_root) = env:: var ( "SDKROOT" ) . ok ( ) {
59
59
let sdk_root_p = Path :: new ( & sdk_root) ;
60
- // Ignore SDKROOT if it's not a valid path
60
+ // Ignore ` SDKROOT` if it's not a valid path.
61
61
if !sdk_root_p. is_absolute ( ) || sdk_root_p == Path :: new ( "/" ) || !sdk_root_p. exists ( ) {
62
62
return Ok ( actual_sdk_path) ;
63
63
}
64
- // Ignore SDKROOT if it's clearly set for the wrong platform, which may occur when we're
65
- // compiling a custom build script while targeting iOS for example
66
- match sdk {
64
+ // Ignore ` SDKROOT` if it's clearly set for the wrong platform, which may occur when we're
65
+ // compiling a custom build script while targeting iOS for example.
66
+ return Ok ( match sdk {
67
67
"iphoneos" if sdk_root. contains ( "iPhoneSimulator.platform" )
68
- || sdk_root. contains ( "MacOSX.platform" ) => return Ok ( actual_sdk_path) ,
68
+ || sdk_root. contains ( "MacOSX.platform" ) => actual_sdk_path,
69
69
"iphonesimulator" if sdk_root. contains ( "iPhoneOS.platform" )
70
- || sdk_root. contains ( "MacOSX.platform" ) => return Ok ( actual_sdk_path) ,
70
+ || sdk_root. contains ( "MacOSX.platform" ) => actual_sdk_path,
71
71
"macosx" | "macosx10.15" if sdk_root. contains ( "iPhoneOS.platform" )
72
- || sdk_root. contains ( "iPhoneSimulator.platform" ) => return Ok ( actual_sdk_path) ,
73
- _ => return Ok ( sdk_root) ,
74
- }
72
+ || sdk_root. contains ( "iPhoneSimulator.platform" ) => actual_sdk_path,
73
+ _ => sdk_root,
74
+ } )
75
75
}
76
76
Ok ( actual_sdk_path)
77
77
}
0 commit comments