Browse Source

Added Mono toolchain finding support code.

pull/696/head
Joao Matos 9 years ago
parent
commit
e7f9178ff4
  1. 36
      src/Core/Toolchains/MonoToolchain.cs

36
src/Core/Toolchains/MonoToolchain.cs

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace CppSharp
{
public static class MonoToolchain
{
public static string FindMonoPath()
{
if (Platform.IsWindows)
return @"C:\\Program Files (x86)\\Mono";
else if (Platform.IsMacOS)
return "/Library/Frameworks/Mono.framework/Versions/Current";
throw new NotImplementedException();
}
public static string FindCSharpCompilerPath()
{
if (Platform.IsWindows)
{
List<ToolchainVersion> versions;
if (!MSVCToolchain.GetMSBuildSdks(out versions))
throw new Exception("Could not find MSBuild SDK paths");
var sdk = versions.Last();
return Path.Combine(sdk.Directory, "csc.exe");
}
return Path.Combine(FindMonoPath(), "bin", "mcs.exe");
}
}
}
Loading…
Cancel
Save