Browse Source

Add friendly option to enable exceptions

pg
josetr 3 years ago
parent
commit
63d3f7ade8
  1. 2
      src/CLI/Generator.cs
  2. 4
      src/Parser/ParserOptions.cs

2
src/CLI/Generator.cs

@ -150,7 +150,7 @@ namespace CppSharp @@ -150,7 +150,7 @@ namespace CppSharp
}
if (options.EnableExceptions)
parserOptions.AddArguments("-fcxx-exceptions");
parserOptions.EnableExceptions = true;
driverOptions.GenerateDebugOutput = options.Debug;
driverOptions.CompileCode = options.Compile;

4
src/Parser/ParserOptions.cs

@ -86,6 +86,7 @@ namespace CppSharp.Parser @@ -86,6 +86,7 @@ namespace CppSharp.Parser
TargetTriple.Contains("windows") || TargetTriple.Contains("msvc");
public bool EnableRTTI { get; set; }
public bool EnableExceptions { get; set; }
public LanguageVersion? LanguageVersion { get; set; }
public void BuildForSourceFile(
@ -367,6 +368,9 @@ namespace CppSharp.Parser @@ -367,6 +368,9 @@ namespace CppSharp.Parser
if (!EnableRTTI)
AddArguments("-fno-rtti");
if (EnableExceptions)
AddArguments("-fcxx-exceptions");
}
public string BuiltinsDir

Loading…
Cancel
Save