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 @@ -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);
}

4
src/Generator/Options.cs

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

Loading…
Cancel
Save