Browse Source

Fix `Delegates` namespace being not generated.

In some cases `Delegates` namespace could be attached to a namespace which is not wrapped and as a result of that `Delegates` namespace was also not generated in wrapper code resulting in a wrapper build errors. Change adds extra logic which tries to find the correct library namespace if more than one namespace is present.
pull/1022/head
Rokas Kupstys 8 years ago
parent
commit
03f7f62e95
  1. 9
      src/Generator/Passes/DelegatesPass.cs

9
src/Generator/Passes/DelegatesPass.cs

@ -187,6 +187,15 @@ namespace CppSharp.Passes
).GroupBy(d => d.Name).Where(g => g.Any(d => d.HasDeclarations)).ToList(); ).GroupBy(d => d.Name).Where(g => g.Any(d => d.HasDeclarations)).ToList();
if (groups.Count == 1) if (groups.Count == 1)
parent = groups.Last().Last(); parent = groups.Last().Last();
else
{
foreach (var g in groups)
{
parent = g.ToList().Find(ns => ns.Name == module.LibraryName || ns.Name == module.OutputNamespace);
if (parent != null)
break;
}
}
} }
if (parent == null) if (parent == null)

Loading…
Cancel
Save