|
|
|
@ -39,6 +39,37 @@ namespace CppSharp
@@ -39,6 +39,37 @@ namespace CppSharp
|
|
|
|
|
throw new System.NotImplementedException("Unknown host platform"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SetupTargetTriple() |
|
|
|
|
{ |
|
|
|
|
var tripleBuilder = new StringBuilder(); |
|
|
|
|
|
|
|
|
|
if (options.Architecture == TargetArchitecture.x64) |
|
|
|
|
tripleBuilder.Append("x86_64-"); |
|
|
|
|
else if(options.Architecture == TargetArchitecture.x86) |
|
|
|
|
tripleBuilder.Append("i686-"); |
|
|
|
|
|
|
|
|
|
if (options.Platform == TargetPlatform.Windows) |
|
|
|
|
{ |
|
|
|
|
tripleBuilder.Append("pc-win32-msvc"); |
|
|
|
|
abi = CppAbi.Microsoft; |
|
|
|
|
} |
|
|
|
|
else if (options.Platform == TargetPlatform.MacOS) |
|
|
|
|
{ |
|
|
|
|
tripleBuilder.Append("apple-darwin12.4.0"); |
|
|
|
|
abi = CppAbi.Itanium; |
|
|
|
|
} |
|
|
|
|
else if (options.Platform == TargetPlatform.Linux) |
|
|
|
|
{ |
|
|
|
|
tripleBuilder.Append("linux-gnu"); |
|
|
|
|
abi = CppAbi.Itanium; |
|
|
|
|
|
|
|
|
|
if(options.Cpp11ABI) |
|
|
|
|
tripleBuilder.Append("-cxx11abi"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
triple = tripleBuilder.ToString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool ValidateOptions(List<string> messages) |
|
|
|
|
{ |
|
|
|
|
if (!options.Platform.HasValue) |
|
|
|
@ -102,32 +133,8 @@ namespace CppSharp
@@ -102,32 +133,8 @@ namespace CppSharp
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
StringBuilder tripleBuilder = new StringBuilder(); |
|
|
|
|
if (options.Architecture == TargetArchitecture.x64) |
|
|
|
|
tripleBuilder.Append("x86_64-"); |
|
|
|
|
else if(options.Architecture == TargetArchitecture.x86) |
|
|
|
|
tripleBuilder.Append("i686-"); |
|
|
|
|
|
|
|
|
|
if (options.Platform == TargetPlatform.Windows) |
|
|
|
|
{ |
|
|
|
|
tripleBuilder.Append("pc-win32-msvc"); |
|
|
|
|
abi = CppAbi.Microsoft; |
|
|
|
|
} |
|
|
|
|
else if (options.Platform == TargetPlatform.MacOS) |
|
|
|
|
{ |
|
|
|
|
tripleBuilder.Append("apple-darwin12.4.0"); |
|
|
|
|
abi = CppAbi.Itanium; |
|
|
|
|
} |
|
|
|
|
else if (options.Platform == TargetPlatform.Linux) |
|
|
|
|
{ |
|
|
|
|
tripleBuilder.Append("linux-gnu"); |
|
|
|
|
abi = CppAbi.Itanium; |
|
|
|
|
|
|
|
|
|
if(options.Cpp11ABI) |
|
|
|
|
tripleBuilder.Append("-cxx11abi"); |
|
|
|
|
} |
|
|
|
|
SetupTargetTriple(); |
|
|
|
|
|
|
|
|
|
triple = tripleBuilder.ToString(); |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|