|
|
|
|
@ -14,6 +14,8 @@ namespace CppSharp
@@ -14,6 +14,8 @@ namespace CppSharp
|
|
|
|
|
/// </summary>
|
|
|
|
|
class ParserGen : ILibrary |
|
|
|
|
{ |
|
|
|
|
const string LINUX_INCLUDE_BASE_DIR = "../../../../deps/x86_64-linux-gnu"; |
|
|
|
|
|
|
|
|
|
internal readonly GeneratorKind Kind; |
|
|
|
|
internal readonly string Triple; |
|
|
|
|
internal readonly CppAbi Abi; |
|
|
|
|
@ -63,6 +65,9 @@ namespace CppSharp
@@ -63,6 +65,9 @@ namespace CppSharp
|
|
|
|
|
if (Triple.Contains("apple")) |
|
|
|
|
SetupMacOptions(options); |
|
|
|
|
|
|
|
|
|
if (Triple.Contains("linux")) |
|
|
|
|
SetupLinuxOptions(options); |
|
|
|
|
|
|
|
|
|
var basePath = Path.Combine(GetSourceDirectory("src"), "CppParser"); |
|
|
|
|
options.addIncludeDirs(basePath); |
|
|
|
|
options.addLibraryDirs("."); |
|
|
|
|
@ -77,6 +82,26 @@ namespace CppSharp
@@ -77,6 +82,26 @@ namespace CppSharp
|
|
|
|
|
options.CheckSymbols = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void SetupLinuxOptions(DriverOptions options) |
|
|
|
|
{ |
|
|
|
|
options.MicrosoftMode = false; |
|
|
|
|
options.NoBuiltinIncludes = true; |
|
|
|
|
|
|
|
|
|
string[] sysincdirs = new[] { |
|
|
|
|
"/usr/include/c++/4.8", |
|
|
|
|
"/usr/include/x86_64-linux-gnu/c++/4.8", |
|
|
|
|
"/usr/include/c++/4.8/backward", |
|
|
|
|
"/usr/lib/gcc/x86_64-linux-gnu/4.8/include", |
|
|
|
|
"/usr/include/x86_64-linux-gnu", |
|
|
|
|
"/usr/include", |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
foreach (var dir in sysincdirs) |
|
|
|
|
{ |
|
|
|
|
options.addSystemIncludeDirs(LINUX_INCLUDE_BASE_DIR + dir); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void SetupMacOptions(DriverOptions options) |
|
|
|
|
{ |
|
|
|
|
options.MicrosoftMode = false; |
|
|
|
|
@ -131,6 +156,14 @@ namespace CppSharp
@@ -131,6 +156,14 @@ namespace CppSharp
|
|
|
|
|
CppAbi.Itanium)); |
|
|
|
|
Console.WriteLine(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (Directory.Exists(LINUX_INCLUDE_BASE_DIR)) |
|
|
|
|
{ |
|
|
|
|
Console.WriteLine("Generating the C# parser bindings for Linux..."); |
|
|
|
|
ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "x86_64-linux-gnu", |
|
|
|
|
CppAbi.Itanium)); |
|
|
|
|
Console.WriteLine(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|