@ -12,7 +12,7 @@ namespace CppSharp
/// <summary>
/// Target platform for code compilation.
/// </summary>
public TargetPlatform Platform;
public TargetPlatform? Platform;
/// Specifies the VS version.
@ -77,5 +77,22 @@ namespace CppSharp
return platform == PlatformID.Unix || platform == PlatformID.MacOSX;
}
public static TargetPlatform Host
{
get
if (IsWindows)
return TargetPlatform.Windows;
if (IsMacOS)
return TargetPlatform.MacOS;
if (IsLinux)
return TargetPlatform.Linux;
throw new NotImplementedException();
@ -48,6 +48,9 @@ namespace CppSharp
void ValidateOptions()
if (!Options.Compilation.Platform.HasValue)
Options.Compilation.Platform = Platform.Host;
foreach (var module in Options.Modules)
if (string.IsNullOrWhiteSpace(module.LibraryName))