Browse Source

Update driver to only generate system modules for C# generators.

pull/1543/head
Joao Matos 5 years ago committed by João Matos
parent
commit
6a1db77cbf
  1. 10
      src/Generator/Generator.cs
  2. 1
      tests/NamespacesDerived/NamespacesDerived.CSharp.csproj

10
src/Generator/Generator.cs

@ -114,7 +114,9 @@ namespace CppSharp.Generators @@ -114,7 +114,9 @@ namespace CppSharp.Generators
}
}
if (Context.Options.SystemModule != null)
var generateSystemModule = Context.Options.SystemModule != null &&
Context.Options.GeneratorKind == GeneratorKind.CSharp;
if (generateSystemModule)
{
var output = GenerateModule(Context.Options.SystemModule);
if (output != null)
@ -150,6 +152,10 @@ namespace CppSharp.Generators @@ -150,6 +152,10 @@ namespace CppSharp.Generators
public virtual GeneratorOutput GenerateModule(Module module)
{
var generatedUnits = module.Units.GetGenerated().ToList();
if (generatedUnits.Count == 0)
return null;
var output = new GeneratorOutput
{
TranslationUnit = new TranslationUnit
@ -157,7 +163,7 @@ namespace CppSharp.Generators @@ -157,7 +163,7 @@ namespace CppSharp.Generators
FilePath = $"{module.LibraryName}",
Module = module
},
Outputs = Generate(module.Units.GetGenerated())
Outputs = Generate(generatedUnits)
};
output.Outputs[0].Process();

1
tests/NamespacesDerived/NamespacesDerived.CSharp.csproj

@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
<ItemGroup>
<Compile Include="$(GenDir)NamespacesDerived\NamespacesDerived.cs" />
<Compile Include="$(GenDir)NamespacesDerived\Std.cs" />
</ItemGroup>
<ItemGroup>

Loading…
Cancel
Save