@@ -2705,39 +2705,38 @@ impl Build {
2705
2705
let sdk_path = self . apple_sdk_root ( & sdk_details. sdk ) ?;
2706
2706
2707
2707
cmd. args . push ( "-isysroot" . into ( ) ) ;
2708
- cmd. args . push ( sdk_path) ;
2709
- }
2710
-
2711
- if let AppleArchSpec :: Catalyst ( _) = arch {
2712
- // Mac Catalyst uses the macOS SDK, but to compile against and
2713
- // link to iOS-specific frameworks, we should have the support
2714
- // library stubs in the include and library search path.
2715
- let sdk_path = self . apple_sdk_root ( & sdk_details. sdk ) ?;
2716
- let ios_support = PathBuf :: from ( sdk_path) . join ( "/System/iOSSupport" ) ;
2717
-
2718
- cmd. args . extend ( [
2719
- // Header search path
2720
- OsString :: from ( "-isystem" ) ,
2721
- ios_support. join ( "/usr/include" ) . into ( ) ,
2722
- // Framework header search path
2723
- OsString :: from ( "-iframework" ) ,
2724
- ios_support. join ( "/System/Library/Frameworks" ) . into ( ) ,
2725
- // Library search path
2726
- {
2727
- let mut s = OsString :: from ( "-L" ) ;
2728
- s. push ( & ios_support. join ( "/usr/lib" ) ) ;
2729
- s
2730
- } ,
2731
- // Framework linker search path
2732
- {
2733
- // Technically, we _could_ avoid emitting `-F`, as
2734
- // `-iframework` implies it, but let's keep it in for
2735
- // clarity.
2736
- let mut s = OsString :: from ( "-F" ) ;
2737
- s. push ( & ios_support. join ( "/System/Library/Frameworks" ) ) ;
2738
- s
2739
- } ,
2740
- ] ) ;
2708
+ cmd. args . push ( sdk_path. clone ( ) ) ;
2709
+
2710
+ if let AppleArchSpec :: Catalyst ( _) = arch {
2711
+ // Mac Catalyst uses the macOS SDK, but to compile against and
2712
+ // link to iOS-specific frameworks, we should have the support
2713
+ // library stubs in the include and library search path.
2714
+ let ios_support = PathBuf :: from ( sdk_path) . join ( "System/iOSSupport" ) ;
2715
+
2716
+ cmd. args . extend ( [
2717
+ // Header search path
2718
+ OsString :: from ( "-isystem" ) ,
2719
+ ios_support. join ( "usr/include" ) . into ( ) ,
2720
+ // Framework header search path
2721
+ OsString :: from ( "-iframework" ) ,
2722
+ ios_support. join ( "System/Library/Frameworks" ) . into ( ) ,
2723
+ // Library search path
2724
+ {
2725
+ let mut s = OsString :: from ( "-L" ) ;
2726
+ s. push ( & ios_support. join ( "usr/lib" ) ) ;
2727
+ s
2728
+ } ,
2729
+ // Framework linker search path
2730
+ {
2731
+ // Technically, we _could_ avoid emitting `-F`, as
2732
+ // `-iframework` implies it, but let's keep it in for
2733
+ // clarity.
2734
+ let mut s = OsString :: from ( "-F" ) ;
2735
+ s. push ( & ios_support. join ( "System/Library/Frameworks" ) ) ;
2736
+ s
2737
+ } ,
2738
+ ] ) ;
2739
+ }
2741
2740
}
2742
2741
2743
2742
Ok ( ( ) )
0 commit comments