Skip to content

Commit fbac357

Browse files
authored
Fix CMake module generator (#98)
***NO_CI***
1 parent 8735ba4 commit fbac357

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

source/MetadataProcessor.Core/SkeletonGenerator/AssemblyClass.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,9 @@ public class ParameterDeclaration
6464
public string MarshallingDeclaration;
6565
public string Declaration;
6666
}
67+
68+
public class ClassWithStubs
69+
{
70+
public string Name;
71+
}
6772
}

source/MetadataProcessor.Core/SkeletonGenerator/AssemblyClassTable.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ public class AssemblyClassTable
1515
public bool IsInterop;
1616

1717
public List<Class> Classes = new List<Class>();
18+
public List<ClassWithStubs> ClassesWithStubs = new List<ClassWithStubs>();
1819
}
1920
}

source/MetadataProcessor.Core/SkeletonGenerator/SkeletonTemplates.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,11 @@ struct {{ClassName}}
267267
268268
{{ProjectName}}.cpp
269269
{{#if IsInterop}}
270-
{{#each Classes}}
270+
{{#each ClassesWithStubs}}
271271
{{HeaderFileName}}_{{Name}}_mshl.cpp
272272
{{HeaderFileName}}_{{Name}}.cpp{{/each}}
273273
{{#else}}
274-
{{#each Classes}}
274+
{{#each ClassesWithStubs}}
275275
{{HeaderFileName}}_{{Name}}.cpp{{/each}}
276276
{{/if}}
277277
)

source/MetadataProcessor.Core/nanoSkeletonGenerator.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Mustache;
88
using nanoFramework.Tools.MetadataProcessor.Core.Extensions;
99
using System;
10+
using System.Collections.Generic;
1011
using System.IO;
1112
using System.Linq;
1213
using System.Text;
@@ -76,6 +77,8 @@ public void GenerateSkeleton()
7677

7778
private void GenerateStubs()
7879
{
80+
var generatedFiles = new List<string>();
81+
7982
var classList = new AssemblyClassTable
8083
{
8184
AssemblyName = _tablesContext.AssemblyDefinition.Name.Name,
@@ -235,6 +238,12 @@ private void GenerateStubs()
235238
var output = generator.Render(classStubs);
236239
headerFile.Write(output);
237240
}
241+
242+
// add class to list of classes with stubs
243+
classList.ClassesWithStubs.Add(new ClassWithStubs()
244+
{
245+
Name = className
246+
});
238247
}
239248
else
240249
{
@@ -269,6 +278,12 @@ private void GenerateStubs()
269278
var output = generator.Render(classStubs);
270279
headerFile.Write(output);
271280
}
281+
282+
// add class to list of classes with stubs
283+
classList.ClassesWithStubs.Add(new ClassWithStubs()
284+
{
285+
Name = className
286+
});
272287
}
273288
}
274289
}

0 commit comments

Comments
 (0)