diff --git a/src/Generator/Driver.cs b/src/Generator/Driver.cs index 907046c7..eb5855d5 100644 --- a/src/Generator/Driver.cs +++ b/src/Generator/Driver.cs @@ -351,8 +351,11 @@ namespace CppSharp } } - public void CompileCode() - { + public void CompileCode() + { + if (!Options.CompileCode) + return; + var assemblyFile = string.IsNullOrEmpty(Options.LibraryName) ? "out.dll" : Options.LibraryName + ".dll"; diff --git a/src/Generator/Options.cs b/src/Generator/Options.cs index e64e26fd..89efa28d 100644 --- a/src/Generator/Options.cs +++ b/src/Generator/Options.cs @@ -101,6 +101,11 @@ namespace CppSharp public List NoGenIncludeDirs; public string NoGenIncludePrefix = ""; + /// + /// Wether the generated C# code should be automatically compiled. + /// + public bool CompileCode; + /// /// Enable this option to enable generation of finalizers. /// Works in both CLI and C# backends.