Browse Source

Deleted Obsolete Options and replaced them with Modules (#828)

Fixes #766
pull/832/head
Mohit Mohta 8 years ago committed by Dimitar Dobrev
parent
commit
185cbfdcf6
  1. 33
      src/CppParser/Bootstrap/Bootstrap.cs
  2. 45
      src/Generator/Options.cs

33
src/CppParser/Bootstrap/Bootstrap.cs

@ -31,27 +31,36 @@ namespace CppSharp @@ -31,27 +31,36 @@ namespace CppSharp
public void Setup(Driver driver)
{
var options = driver.Options;
options.LibraryName = "CppSharp";
options.GeneratorKind = GeneratorKind.CSharp;
options.DryRun = true;
options.Headers.AddRange(new string[]
{
"clang/AST/Expr.h",
});
options.SetupXcode();
options.MicrosoftMode = false;
options.TargetTriple = "i686-apple-darwin12.4.0";
options.addDefines ("__STDC_LIMIT_MACROS");
options.addDefines ("__STDC_CONSTANT_MACROS");
var module = options.AddModule("CppSharp");
module.Defines.Add("__STDC_LIMIT_MACROS");
module.Defines.Add("__STDC_CONSTANT_MACROS");
var llvmPath = Path.Combine (GetSourceDirectory ("deps"), "llvm");
var clangPath = Path.Combine(llvmPath, "tools", "clang");
options.addIncludeDirs(Path.Combine(llvmPath, "include"));
options.addIncludeDirs(Path.Combine(llvmPath, "build", "include"));
options.addIncludeDirs (Path.Combine (llvmPath, "build", "tools", "clang", "include"));
options.addIncludeDirs(Path.Combine(clangPath, "include"));
module.IncludeDirs.AddRange(new[]
{
Path.Combine(llvmPath, "include"),
Path.Combine(llvmPath, "build", "include"),
Path.Combine(llvmPath, "build", "tools", "clang", "include"),
Path.Combine(clangPath, "include")
});
module.Headers.AddRange(new[]
{
"clang/AST/Expr.h",
"CppSharp.h"
});
module.LibraryDirs.Add(Path.Combine(llvmPath, "lib"));
module.Libraries.Add("CppSharp.lib");
}
public void SetupPasses(Driver driver)

45
src/Generator/Options.cs

@ -68,51 +68,6 @@ namespace CppSharp @@ -68,51 +68,6 @@ namespace CppSharp
public Module SystemModule { get; }
public List<Module> Modules { get; }
[Obsolete("Do not use.")]
public Module MainModule
{
get
{
if (Modules.Count == 1)
AddModule("Main");
return Modules[1];
}
}
[Obsolete("Use Modules and Module.Headers instead.")]
public List<string> Headers => MainModule.Headers;
[Obsolete("Use Modules and Module.Libraries instead.")]
public List<string> Libraries => MainModule.Libraries;
[Obsolete("Use Modules and Module.SharedLibraryName instead.")]
public string SharedLibraryName
{
get { return MainModule.SharedLibraryName; }
set { MainModule.SharedLibraryName = value; }
}
[Obsolete("Use Modules and Module.OutputNamespace instead.")]
public string OutputNamespace
{
get { return MainModule.OutputNamespace; }
set { MainModule.OutputNamespace = value; }
}
[Obsolete("Use Modules and Module.LibraryName instead.")]
public string LibraryName
{
get { return MainModule.LibraryName; }
set { MainModule.LibraryName = value; }
}
[Obsolete("Use Modules and Module.SymbolsLibraryName instead.")]
public string SymbolsLibraryName
{
get { return MainModule.SymbolsLibraryName; }
set { MainModule.SymbolsLibraryName = value; }
}
public Module AddModule(string libraryName)
{
var module = new Module(libraryName);

Loading…
Cancel
Save