Browse Source

Improved the searching for the correct native lib to import.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/719/head 0.7.10
Dimitar Dobrev 9 years ago
parent
commit
2a3fed61b7
  1. 12
      src/Generator/Generators/CSharp/CSharpSources.cs

12
src/Generator/Generators/CSharp/CSharpSources.cs

@ -3171,14 +3171,12 @@ namespace CppSharp.Generators.CSharp @@ -3171,14 +3171,12 @@ namespace CppSharp.Generators.CSharp
string libName = declaration.TranslationUnit.Module.SharedLibraryName;
if (Options.CheckSymbols)
{
NativeLibrary library;
Context.Symbols.FindLibraryBySymbol(((IMangledDecl) declaration).Mangled, out library);
NativeLibrary library;
Context.Symbols.FindLibraryBySymbol(((IMangledDecl) declaration).Mangled, out library);
if (library != null)
libName = Path.GetFileNameWithoutExtension(library.FileName);
if (library != null)
libName = Path.GetFileNameWithoutExtension(library.FileName);
}
if (Options.StripLibPrefix && libName != null && libName.Length > 3 &&
libName.StartsWith("lib", StringComparison.Ordinal))
{

Loading…
Cancel
Save