public void Setup(Driver driver) { var parserOptions = driver.ParserOptions; parserOptions.TargetTriple = Triple; parserOptions.Abi = Abi; var options = driver.Options; options.GeneratorKind = Kind; options.CommentKind = CommentKind.BCPLSlash; var parserModule = options.AddModule("CppSharp.CppParser"); parserModule.Headers.AddRange(new[] { "AST.h", "Sources.h", "CppParser.h" }); parserModule.Libraries.Add("CppSharp.CppParser.lib"); parserModule.OutputNamespace = string.Empty; if (Abi == CppAbi.Microsoft) { parserOptions.MicrosoftMode = true; } if (Triple.Contains("apple")) { SetupMacOptions(parserOptions); } if (Triple.Contains("linux")) { SetupLinuxOptions(parserOptions); } var basePath = Path.Combine(GetSourceDirectory("src"), "CppParser"); parserOptions.AddIncludeDirs(basePath); parserOptions.AddLibraryDirs("."); options.OutputDir = Path.Combine(GetSourceDirectory("src"), "CppParser", "Bindings", Kind.ToString()); var extraTriple = IsGnuCpp11Abi ? "-cxx11abi" : string.Empty; if (Kind == GeneratorKind.CSharp) { options.OutputDir = Path.Combine(options.OutputDir, parserOptions.TargetTriple + extraTriple); } options.CheckSymbols = false; //options.Verbose = true; options.UnityBuild = true; }
private static string GetGeneratorKindName(GeneratorKind kind) { switch (kind) { case GeneratorKind.CLI: return("C++/CLI"); case GeneratorKind.CSharp: return("C#"); default: return(kind.ToString()); } }
public void Setup(Driver driver) { var options = driver.Options; options.TargetTriple = Triple; options.Abi = Abi; options.LibraryName = "CppSharp.CppParser.dll"; options.GeneratorKind = Kind; options.GenerateCopyConstructors = true; options.Headers.AddRange(new string[] { "AST.h", "Sources.h", "CppParser.h" }); options.Libraries.Add("CppSharp.CppParser.lib"); if (Abi == CppAbi.Microsoft) { options.MicrosoftMode = true; } if (Triple.Contains("apple")) { SetupMacOptions(options); } if (Triple.Contains("linux")) { SetupLinuxOptions(options); } var basePath = Path.Combine(GetSourceDirectory("src"), "CppParser"); options.addIncludeDirs(basePath); options.addLibraryDirs("."); options.OutputDir = Path.Combine(GetSourceDirectory("src"), "CppParser", "Bindings", Kind.ToString()); if (Kind == GeneratorKind.CSharp) { options.OutputDir = Path.Combine(options.OutputDir, options.TargetTriple); } options.GenerateLibraryNamespace = false; options.CheckSymbols = false; }
public void Setup(Driver driver) { var options = driver.Options; options.TargetTriple = Triple; options.Abi = Abi; options.LibraryName = "CppSharp.CppParser.dll"; options.GeneratorKind = Kind; options.Headers.AddRange(new string[] { "AST.h", "Sources.h", "CppParser.h" }); options.Libraries.Add("CppSharp.CppParser.lib"); if (Triple.Contains("apple")) { SetupMacOptions(options); } var basePath = Path.Combine(GetSourceDirectory(), "CppParser"); #if OLD_PARSER options.IncludeDirs.Add(basePath); options.LibraryDirs.Add("."); #else options.addIncludeDirs(basePath); options.addLibraryDirs("."); #endif options.OutputDir = "../../../../src/CppParser/Bindings/"; options.OutputDir += Kind.ToString(); if (Kind == GeneratorKind.CSharp) { options.OutputDir += "/" + options.TargetTriple; } options.GenerateLibraryNamespace = false; options.CheckSymbols = false; options.Verbose = false; }