From 2426c3eedb8e1878f83ab5dcbfda6b3d5b2e32fe Mon Sep 17 00:00:00 2001 From: triton Date: Mon, 14 Apr 2014 03:09:41 +0100 Subject: [PATCH] Added an option to compile the generated C# code. --- src/Generator/Driver.cs | 7 +++++-- src/Generator/Options.cs | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) 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.