File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -27,16 +27,34 @@ public static string GetXcodeToolchainPath()
27
27
return toolchainPath ;
28
28
}
29
29
30
+ public static string GetXcodeSDKPath ( ) {
31
+ return Path . Combine (
32
+ GetXcodePath ( ) ,
33
+ "Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
34
+ ) ;
35
+ }
36
+
30
37
public static string GetXcodeCppIncludesFolder ( )
31
38
{
32
39
var toolchainPath = GetXcodeToolchainPath ( ) ;
40
+ var sdkPath = GetXcodeSDKPath ( ) ;
33
41
34
- var includePath = Path . Combine ( toolchainPath , "usr/include/c++/v1" ) ;
42
+ var includePathSuffix = "usr/include/c++/v1" ;
43
+ var oldIncludePath = Path . Combine ( toolchainPath , includePathSuffix ) ;
44
+ var newIncludePath = Path . Combine ( sdkPath , includePathSuffix ) ;
35
45
36
- if ( includePath == null || ! Directory . Exists ( includePath ) )
37
- throw new Exception ( $ "Could not find a valid C++ include folder: { includePath } ") ;
46
+ if ( newIncludePath != null && Directory . Exists ( newIncludePath ) )
47
+ {
48
+ return newIncludePath ;
49
+ }
50
+
51
+ if ( oldIncludePath != null && Directory . Exists ( oldIncludePath ) )
52
+ {
53
+ return oldIncludePath ;
54
+ }
38
55
39
- return includePath ;
56
+ throw new Exception (
57
+ $ "Could not find a valid C++ include folder in either { oldIncludePath } or { newIncludePath } ") ;
40
58
}
41
59
42
60
public static string GetXcodeBuiltinIncludesFolder ( )
@@ -107,4 +125,4 @@ private static string GetXcodePathFromFileSystem()
107
125
return toolchainPath ;
108
126
}
109
127
}
110
- }
128
+ }
You can’t perform that action at this time.
0 commit comments