diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 87aab5b4..6454db61 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -2785,7 +2785,7 @@ namespace CppSharp.Generators.CSharp if (library != null) libName = Path.GetFileNameWithoutExtension(library.FileName); } - if (libName != null && libName.Length > 3 && libName.StartsWith("lib")) + if (Options.StripLibPrefix && libName != null && libName.Length > 3 && libName.StartsWith("lib")) { libName = libName.Substring(3); } diff --git a/src/Generator/Options.cs b/src/Generator/Options.cs index f64a2f38..72a0358a 100644 --- a/src/Generator/Options.cs +++ b/src/Generator/Options.cs @@ -42,6 +42,8 @@ namespace CppSharp Encoding = Encoding.ASCII; CodeFiles = new List(); + + StripLibPrefix = true; } // General options @@ -185,6 +187,8 @@ namespace CppSharp /// Generates default values of arguments in the C# code. /// public bool GenerateDefaultValuesForArguments { get; set; } + + public bool StripLibPrefix { get; set; } } public class InvalidOptionException : Exception