зеркало из https://github.com/mono/CppSharp.git
Fix Xcode C++ include path (#1844)
This commit is contained in:
Родитель
81e0a931cf
Коммит
3f923b1c64
|
@ -27,16 +27,34 @@ namespace CppSharp
|
|||
return toolchainPath;
|
||||
}
|
||||
|
||||
public static string GetXcodeSDKPath() {
|
||||
return Path.Combine(
|
||||
GetXcodePath(),
|
||||
"Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
|
||||
);
|
||||
}
|
||||
|
||||
public static string GetXcodeCppIncludesFolder()
|
||||
{
|
||||
var toolchainPath = GetXcodeToolchainPath();
|
||||
var sdkPath = GetXcodeSDKPath();
|
||||
|
||||
var includePath = Path.Combine(toolchainPath, "usr/include/c++/v1");
|
||||
var includePathSuffix = "usr/include/c++/v1";
|
||||
var oldIncludePath = Path.Combine(toolchainPath, includePathSuffix);
|
||||
var newIncludePath = Path.Combine(sdkPath, includePathSuffix);
|
||||
|
||||
if (includePath == null || !Directory.Exists(includePath))
|
||||
throw new Exception($"Could not find a valid C++ include folder: {includePath}");
|
||||
if (newIncludePath != null && Directory.Exists(newIncludePath))
|
||||
{
|
||||
return newIncludePath;
|
||||
}
|
||||
|
||||
return includePath;
|
||||
if (oldIncludePath != null && Directory.Exists(oldIncludePath))
|
||||
{
|
||||
return oldIncludePath;
|
||||
}
|
||||
|
||||
throw new Exception(
|
||||
$"Could not find a valid C++ include folder in either {oldIncludePath} or {newIncludePath}");
|
||||
}
|
||||
|
||||
public static string GetXcodeBuiltinIncludesFolder()
|
||||
|
@ -107,4 +125,4 @@ namespace CppSharp
|
|||
return toolchainPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче