|
|
|
@ -216,55 +216,45 @@ namespace CppSharp
@@ -216,55 +216,45 @@ namespace CppSharp
|
|
|
|
|
public void Run() |
|
|
|
|
{ |
|
|
|
|
StringBuilder messageBuilder = new StringBuilder(); |
|
|
|
|
messageBuilder.Append("Generating "); |
|
|
|
|
messageBuilder.Append($"Generating {GetGeneratorKindName(options.Kind)}"); |
|
|
|
|
messageBuilder.Append($" bindings for {GetPlatformName(options.Platform)} {options.Architecture}"); |
|
|
|
|
|
|
|
|
|
switch(options.Kind) |
|
|
|
|
{ |
|
|
|
|
case GeneratorKind.CLI: |
|
|
|
|
messageBuilder.Append("C++/CLI"); |
|
|
|
|
break; |
|
|
|
|
case GeneratorKind.CSharp: |
|
|
|
|
messageBuilder.Append("C#"); |
|
|
|
|
break; |
|
|
|
|
if (options.Cpp11ABI) |
|
|
|
|
messageBuilder.Append(" (GCC C++11 ABI)"); |
|
|
|
|
|
|
|
|
|
messageBuilder.Append("..."); |
|
|
|
|
Console.WriteLine(messageBuilder.ToString()); |
|
|
|
|
|
|
|
|
|
ConsoleDriver.Run(this); |
|
|
|
|
|
|
|
|
|
Console.WriteLine(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
messageBuilder.Append(" bindings for "); |
|
|
|
|
private static string GetPlatformName(TargetPlatform? platform) |
|
|
|
|
{ |
|
|
|
|
if (!platform.HasValue) |
|
|
|
|
return string.Empty; |
|
|
|
|
|
|
|
|
|
switch (options.Platform) |
|
|
|
|
switch (platform.Value) |
|
|
|
|
{ |
|
|
|
|
case TargetPlatform.Linux: |
|
|
|
|
messageBuilder.Append("Linux"); |
|
|
|
|
break; |
|
|
|
|
case TargetPlatform.MacOS: |
|
|
|
|
messageBuilder.Append("OSX"); |
|
|
|
|
break; |
|
|
|
|
case TargetPlatform.Windows: |
|
|
|
|
messageBuilder.Append("Windows"); |
|
|
|
|
break; |
|
|
|
|
return "macOS"; |
|
|
|
|
default: |
|
|
|
|
return platform.ToString(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
messageBuilder.Append(" "); |
|
|
|
|
|
|
|
|
|
switch (options.Architecture) |
|
|
|
|
private static string GetGeneratorKindName(GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
case TargetArchitecture.x86: |
|
|
|
|
messageBuilder.Append("x86"); |
|
|
|
|
break; |
|
|
|
|
case TargetArchitecture.x64: |
|
|
|
|
messageBuilder.Append("x64"); |
|
|
|
|
break; |
|
|
|
|
switch (kind) |
|
|
|
|
{ |
|
|
|
|
case GeneratorKind.CLI: |
|
|
|
|
return "C++/CLI"; |
|
|
|
|
case GeneratorKind.CSharp: |
|
|
|
|
return "C#"; |
|
|
|
|
default: |
|
|
|
|
return kind.ToString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(options.Cpp11ABI) |
|
|
|
|
messageBuilder.Append(" (GCC C++11 ABI)"); |
|
|
|
|
|
|
|
|
|
messageBuilder.Append("..."); |
|
|
|
|
|
|
|
|
|
Console.WriteLine(messageBuilder.ToString()); |
|
|
|
|
|
|
|
|
|
ConsoleDriver.Run(this); |
|
|
|
|
|
|
|
|
|
Console.WriteLine(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|