From 719c1193add9578e431094c4e0bcf10b8d74ee08 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Thu, 18 Sep 2014 22:20:26 +0300 Subject: [PATCH] Added an option controlling the stripping of the "lib" prefix, if any, of the wrapped lib. Signed-off-by: Dimitar Dobrev --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 2 +- src/Generator/Options.cs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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