|
|
|
@ -1,5 +1,4 @@
@@ -1,5 +1,4 @@
|
|
|
|
|
using System; |
|
|
|
|
using System.Diagnostics; |
|
|
|
|
using System.IO; |
|
|
|
|
using System.Reflection; |
|
|
|
|
using System.Text.RegularExpressions; |
|
|
|
@ -44,7 +43,7 @@ namespace CppSharp.Utils
@@ -44,7 +43,7 @@ namespace CppSharp.Utils
|
|
|
|
|
options.SharedLibraryName += ".dll"; |
|
|
|
|
|
|
|
|
|
if (Platform.IsMacOS) |
|
|
|
|
options.TargetTriple = Is32bitMono() ? "i686-apple-darwin" : "x86_64-apple-darwin"; |
|
|
|
|
options.TargetTriple = Environment.Is64BitProcess ? "x86_64-apple-darwin" : "i686-apple-darwin"; |
|
|
|
|
|
|
|
|
|
var path = Path.GetFullPath(GetTestsDirectory(name)); |
|
|
|
|
options.addIncludeDirs(path); |
|
|
|
@ -121,24 +120,6 @@ namespace CppSharp.Utils
@@ -121,24 +120,6 @@ namespace CppSharp.Utils
|
|
|
|
|
|
|
|
|
|
throw new Exception("Could not find tests output directory"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static bool Is32bitMono() |
|
|
|
|
{ |
|
|
|
|
var process = new Process(); |
|
|
|
|
process.StartInfo.FileName = "mono"; |
|
|
|
|
process.StartInfo.Arguments = "--version"; |
|
|
|
|
process.StartInfo.CreateNoWindow = true; |
|
|
|
|
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; |
|
|
|
|
process.StartInfo.UseShellExecute = false; |
|
|
|
|
process.StartInfo.RedirectStandardError = true; |
|
|
|
|
process.StartInfo.RedirectStandardOutput = true; |
|
|
|
|
process.Start(); |
|
|
|
|
|
|
|
|
|
var output = process.StandardOutput.ReadToEnd(); |
|
|
|
|
process.WaitForExit(); |
|
|
|
|
|
|
|
|
|
return output.Contains("x86"); |
|
|
|
|
} |
|
|
|
|
#endregion
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|