Browse Source

Merge pull request #325 from ddobrev/master

Added an option controlling the stripping of the "lib" prefix, if any, of the wrapped lib
pull/327/head
João Matos 11 years ago
parent
commit
dcd294f3ee
  1. 2
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  2. 4
      src/Generator/Options.cs

2
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -2785,7 +2785,7 @@ namespace CppSharp.Generators.CSharp
if (library != null) if (library != null)
libName = Path.GetFileNameWithoutExtension(library.FileName); 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); libName = libName.Substring(3);
} }

4
src/Generator/Options.cs

@ -42,6 +42,8 @@ namespace CppSharp
Encoding = Encoding.ASCII; Encoding = Encoding.ASCII;
CodeFiles = new List<string>(); CodeFiles = new List<string>();
StripLibPrefix = true;
} }
// General options // General options
@ -185,6 +187,8 @@ namespace CppSharp
/// Generates default values of arguments in the C# code. /// Generates default values of arguments in the C# code.
/// </summary> /// </summary>
public bool GenerateDefaultValuesForArguments { get; set; } public bool GenerateDefaultValuesForArguments { get; set; }
public bool StripLibPrefix { get; set; }
} }
public class InvalidOptionException : Exception public class InvalidOptionException : Exception

Loading…
Cancel
Save