Browse Source

Added RTTI flag to the CLI tool.

pull/1139/head
Joao Matos 8 years ago
parent
commit
017e119bd0
  1. 3
      src/CLI/CLI.cs
  2. 7
      src/CLI/Generator.cs
  3. 6
      src/CLI/Options.cs

3
src/CLI/CLI.cs

@ -30,7 +30,8 @@ namespace CppSharp @@ -30,7 +30,8 @@ namespace CppSharp
optionSet.Add("p=|platform=", "the {PLATFORM} that the generated code will target: 'win', 'osx' or 'linux'", p => { GetDestinationPlatform(p, errorMessages); } );
optionSet.Add("a=|arch=", "the {ARCHITECTURE} that the generated code will target: 'x86' or 'x64'", a => { GetDestinationArchitecture(a, errorMessages); } );
optionSet.Add("exceptions", "enables support for C++ exceptions in the parser", v => { options.Arguments.Add("-fcxx-exceptions"); });
optionSet.Add("exceptions", "enables support for C++ exceptions in the parser", v => { options.EnableExceptions = true; });
optionSet.Add("rtti", "enables support for C++ RTTI in the parser", v => { options.EnableRTTI = true; });
optionSet.Add("c++11", "enables GCC C++ 11 compilation (valid only for Linux platform)", cpp11 => { options.Cpp11ABI = (cpp11 != null); } );
optionSet.Add("cs|checksymbols", "enable the symbol check for the generated code", cs => { options.CheckSymbols = (cs != null); } );

7
src/CLI/Generator.cs

@ -185,11 +185,16 @@ namespace CppSharp @@ -185,11 +185,16 @@ namespace CppSharp
parserOptions.AddDefines(d.Key + "=" + d.Value);
}
parserOptions.UnityBuild = options.UnityBuild;
parserOptions.EnableRTTI = options.EnableRTTI;
if (options.EnableExceptions)
parserOptions.AddArguments("-fcxx-exceptions");
driverOptions.GenerateDebugOutput = options.Debug;
driverOptions.CompileCode = options.Compile;
driverOptions.OutputDir = options.OutputDir;
driverOptions.CheckSymbols = options.CheckSymbols;
parserOptions.UnityBuild = options.UnityBuild;
driverOptions.Verbose = options.Verbose;
}

6
src/CLI/Options.cs

@ -36,13 +36,17 @@ namespace CppSharp @@ -36,13 +36,17 @@ namespace CppSharp
public TargetArchitecture Architecture { get; set; } = TargetArchitecture.x86;
public GeneratorKind Kind { get; set; } = GeneratorKind.CSharp;
public bool CheckSymbols { get; set; }
public bool UnityBuild { get; set; }
public bool Cpp11ABI { get; set; }
public bool EnableExceptions { get; set; }
public bool EnableRTTI { get; set; }
public bool Compile { get; set; }
public bool Debug { get; set; }

Loading…
Cancel
Save