Skip to content

Commit b8e0fcc

Browse files
committed
Squashed commit of the following:
commit b5ab95e Author: Joao Matos <[email protected]> Date: Thu Feb 1 11:39:24 2024 +0000 Update iOS64 ABI name to the more accurate AppleARM64. commit d1307a5 Author: Joao Matos <[email protected]> Date: Thu Feb 1 11:21:52 2024 +0000 Add support for AArch64 C++ ABI. commit 9071cd2 Author: deadlocklogic <[email protected]> Date: Sun Dec 17 17:03:24 2023 +0200 Implement ClassTemplatePartialSpecialization::Parameters (mono#1809) * Implement ClassTemplatePartialSpecialization::Parameters * Template.cs: Implement ClassTemplatePartialSpecialization.Parameters * GeneratorKind: fix bug introduced while migrating from enum to class * Implement native ClassTemplatePartialSpecialization.Parameters + ASTConverter * regenerated bindings (mono#1813) * regenerated bindings * regenerated bindings after rebase * Directory.Build.props: support C# 10.0 * Implement native ClassTemplatePartialSpecialization.Parameters + ASTConverter * Regenerated bindings * TestAST.cs: add TestASTClassTemplatePartialSpecialization commit 2ecd952 Author: deadlocklogic <[email protected]> Date: Sun Dec 17 13:08:34 2023 +0200 regenerated bindings (mono#1813) * regenerated bindings * regenerated bindings after rebase * Directory.Build.props: support C# 10.0 commit 24d1a84 Author: deadlocklogic <[email protected]> Date: Sun Dec 17 11:44:00 2023 +0200 Stdlib.CSharp.cs: remove buggy typemap (mono#1812) commit 1327971 Author: deadlocklogic <[email protected]> Date: Sat Dec 16 21:36:04 2023 +0200 GeneratorKind: patch bug caused by missing ToString (mono#1811) commit 519e97f Author: Joao Matos <[email protected]> Date: Tue Dec 12 15:30:14 2023 +0000 Remove 32-bit builds and non-debug symbols release builds from LLVM Windows CI. commit 1211272 Author: deadlocklogic <[email protected]> Date: Tue Dec 12 17:25:12 2023 +0200 Build llvm `Debug`/`Release` for `Windows`. (mono#1800) * Update llvm-win.yml * Update llvm-win.yml * Update llvm-win.yml commit 12c267d Author: zylalx1 <[email protected]> Date: Fri Dec 8 03:58:10 2023 +0800 Fixed a bug causing the header file to be included twice when Options.GenerateName is not null (mono#1803) commit e068f2a Author: deadlocklogic <[email protected]> Date: Thu Dec 7 16:35:02 2023 +0200 Typemap cleanup (mono#1802) * TypeMap: prepare refactoring into a modular design * TypeMap: refactor C++ backend into common methods * TypeMap: refactor CLI backend into common methods * CLI.Gen.cs: fix omitted typemap from previous commit * Common.Gen.cs: fixed silly modification while testing * GeneratorKind: add FindGeneratorKindByID method * TypeMapDatabase: heavy refactor: group typemaps by GeneratorKind * TypeMap: refactor CSharp backend into common methods + migration * TypeMap: cleanup patches from previous commits * TypeMapDatabase: fix passing GeneratorKind to FindTypeMap calls * Stdlib.CSharp.cs: move std::map typemap from Stdlib.CLI.cs * TypeMapDatabase: improve parameter name commit 8c2da6d Author: deadlocklogic <[email protected]> Date: Mon Nov 13 22:00:41 2023 +0200 Major refactor: TypePrinter: improve modular design + cleanup (mono#1796) commit 0edd48c Author: deadlocklogic <[email protected]> Date: Mon Nov 13 20:15:24 2023 +0200 Major refactoring: refactor GeneratorKind enum into a class (mono#1794) * Major refactoring: refactor GeneratorKind enum into a class * Minor fix: add readonly * Add Type property for GenerationKind + cleanup * GeneratorKind: add Name property + refactor hardcoded names * GeneratorKind: add CLIOptions property + refactor hardcoded options * CppSharp.CLI: minor fix: use generator.ToLower() * GeneratorKind: fix warning commit 40f3a09 Author: deadlocklogic <[email protected]> Date: Sat Nov 11 16:51:18 2023 +0200 Minor improvements (mono#1793) * CppSharp.Generators.Options: added pre/post TranslationUnitPass callback * CppSharp.Generators.Passes.Pass: added TranslationUnitPassGeneratorDependent commit b14038a Author: Stefan <[email protected]> Date: Mon Oct 23 14:23:51 2023 +0200 Value types may generate `Dispose` (mono#1787) commit 3b2a15d Author: João Matos <[email protected]> Date: Sat Oct 21 19:33:13 2023 +0100 Update README.md commit a5afda8 Author: Stefan <[email protected]> Date: Fri Oct 20 21:00:04 2023 +0200 Fix parameterless constructors not being generated for structs (mono#1783) * Fix parameterless constructors not being generated for structs * Fix implicit non-trivial default ctor * Adjust `Ignore` linked issue commit b16e809 Author: Stefan <[email protected]> Date: Fri Oct 20 18:54:58 2023 +0200 Introduce `GenerateFreeStandingFunctionsClassName` option (mono#1782) * Introduce `GenerateFreeStandingFunctionsClassName` option * Support CLI and fixes commit 03874e7 Author: Stefan <[email protected]> Date: Thu Oct 19 17:24:55 2023 +0200 Fix Value Type String Member Invalid Codegen (mono#1778) * Fix code generation * Generate exception on broken struct set op * Remove redundant usings commit adffc99 Author: Salvage <[email protected]> Date: Thu Oct 19 14:51:06 2023 +0200 Fix erroneous newline commit b4f261e Author: Salvage <[email protected]> Date: Thu Oct 19 14:26:00 2023 +0200 Simplify `IsTemplateParameterType` commit 28000a1 Author: Salvage <[email protected]> Date: Thu Oct 19 01:19:07 2023 +0200 Fix mono#1251 three parameter equality operator - Operators in generic classes do not attempt to generate as extension methods anymore - Empty `...Extensions` classes are no longer generated - `string` as a template argument is correctly cast - `MarshalCharAsManagedChar` option also generates correct casts - Suppress warning regarding returning struct field by ref - Eliminate some tabs that snuck into the test C++ header commit d7faf5f Author: Joao Matos <[email protected]> Date: Wed Oct 18 17:39:49 2023 +0100 Fix SDL_PollEvent generation in the SDL example. Fixes mono#978. Thanks to @Saalvage. commit 7f567b6 Author: Salvage <[email protected]> Date: Wed Oct 18 18:26:03 2023 +0200 Fix non-void returning functions with value-type out parameters Also fixes indentation commit 0c60384 Author: Salvage <[email protected]> Date: Wed Oct 18 16:49:41 2023 +0200 Additional bump commit 0534e33 Author: Salvage <[email protected]> Date: Wed Oct 18 16:35:10 2023 +0200 Bump GH actions versions to solve warnings commit a6ef9d9 Author: Salvage <[email protected]> Date: Wed Oct 18 16:19:42 2023 +0200 Fix source dir commit 7e6c492 Author: Salvage <[email protected]> Date: Wed Oct 18 16:08:51 2023 +0200 Test fix broken packages commit 2a351b7 Author: Joao Matos <[email protected]> Date: Wed Oct 18 16:03:36 2023 +0100 Update our version to 1.1. commit 20950c5 Author: Salvage <[email protected]> Date: Wed Oct 18 04:58:38 2023 +0200 More stringent test; Fix indentation (of the code itself, not in the generator) commit ebe6b8a Author: Salvage <[email protected]> Date: Wed Oct 18 04:47:13 2023 +0200 Fix value type out parameters
1 parent b54eaba commit b8e0fcc

File tree

84 files changed

+2446
-1771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2446
-1771
lines changed

.github/workflows/llvm-win.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
config:
12-
- { os: windows-2022, platform: x86, vs: "Program Files/Microsoft Visual Studio/2022" }
13-
- { os: windows-2022, platform: x64, vs: "Program Files/Microsoft Visual Studio/2022" }
12+
- { os: windows-2022, platform: x64, configuration : Debug, vs: "Program Files/Microsoft Visual Studio/2022" }
13+
- { os: windows-2022, platform: x64, configuration : RelWithDebInfo, vs: "Program Files/Microsoft Visual Studio/2022" }
1414

1515
runs-on: ${{ matrix.config.os }}
1616

@@ -19,6 +19,7 @@ jobs:
1919
CXX: ${{ matrix.config.cxx }}
2020
VS_VERSION: ${{ matrix.config.vs }}
2121
PLATFORM: ${{ matrix.config.platform }}
22+
CONFIGURATION: ${{ matrix.config.configuration }}
2223
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
2324

2425
steps:
@@ -51,16 +52,16 @@ jobs:
5152

5253
- name: Build LLVM
5354
shell: bash
54-
run: build/build.sh build_llvm -platform $PLATFORM
55+
run: build/build.sh build_llvm -platform $PLATFORM -configuration $CONFIGURATION
5556
working-directory: C:\CppSharp
5657

5758
- name: Package LLVM
5859
shell: bash
59-
run: build/build.sh package_llvm -platform $PLATFORM
60+
run: build/build.sh package_llvm -platform $PLATFORM -configuration $CONFIGURATION
6061
working-directory: C:\CppSharp
6162

6263
- name: 'Upload Artifact'
6364
uses: actions/upload-artifact@v3
6465
with:
6566
name: llvm
66-
path: C:\CppSharp\build\llvm\llvm-*-*.*
67+
path: C:\CppSharp\build\llvm\llvm-*-*.*

.github/workflows/llvm.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
2323

2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2626
- uses: lukka/get-cmake@latest
2727

2828
- name: Clone LLVM

.github/workflows/main.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
DOTNET_CLI_TELEMETRY_OPTOUT: true
2525

2626
steps:
27-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v4
2828
with:
2929
fetch-depth: '0'
3030

@@ -63,7 +63,7 @@ jobs:
6363
shell: bash
6464
run: build/build.sh prepack -platform $PLATFORM
6565

66-
- uses: actions/upload-artifact@v2
66+
- uses: actions/upload-artifact@v3
6767
with:
6868
name: intermediate
6969
path: |
@@ -82,14 +82,14 @@ jobs:
8282
DOTNET_CLI_TELEMETRY_OPTOUT: true
8383

8484
steps:
85-
- uses: actions/checkout@v2
85+
- uses: actions/checkout@v4
8686
with:
8787
fetch-depth: '0'
8888

8989
- name: Set version
9090
run: nbgv cloud --all-vars
9191

92-
- uses: actions/download-artifact@v2
92+
- uses: actions/download-artifact@v3
9393
with:
9494
name: intermediate
9595

@@ -102,7 +102,7 @@ jobs:
102102
run: build/build.sh pack
103103

104104
- name: Upload package
105-
uses: actions/upload-artifact@v2
105+
uses: actions/upload-artifact@v3
106106
with:
107107
name: CppSharp.nupkg
108108
path: |

Directory.Build.props

+57-56
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,58 @@
1-
<Project>
2-
<Import Project="build/config.props" />
3-
4-
<PropertyGroup>
5-
<RootDir>$(MSBuildThisFileDirectory)</RootDir>
6-
<Platforms>x86;x64</Platforms>
7-
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
8-
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
9-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
10-
<RepositoryUrl>https://github.com/mono/CppSharp</RepositoryUrl>
11-
<RepositoryCommit>$(GITHUB_SHA)</RepositoryCommit>
12-
<Authors>João Matos, Dimitar Dobrev, Jose Torres</Authors>
13-
<Copyright>João Matos, Dimitar Dobrev</Copyright>
14-
<Version>$(NBGV_Version)</Version>
15-
<AssemblyVersion>$(NBGV_AssemblyVersion)</AssemblyVersion>
16-
<AssemblyFileVersion>$(NBGV_AssemblyFileVersion)</AssemblyFileVersion>
17-
<AssemblyInformationalVersion>$(NBGV_AssemblyInformationalVersion)</AssemblyInformationalVersion>
18-
<IsPackable>false</IsPackable>
19-
<BuildDir>$(RootDir)build\</BuildDir>
20-
<ObjDir>$(BuildDir)obj\</ObjDir>
21-
<GenDir>$(BuildDir)gen\</GenDir>
22-
<SrcDir>$(RootDir)src\</SrcDir>
23-
<GlobalTargetFramework>$(TargetFramework)</GlobalTargetFramework>
24-
<BaseIntermediateOutputPath>$(ObjDir)$(MSBuildProjectName)\</BaseIntermediateOutputPath>
25-
<BaseOutputPath>$(RootDir)bin\</BaseOutputPath>
26-
<OutputPath>$(BaseOutputPath)$(Configuration)_$(PlatformTarget)\</OutputPath>
27-
<ActionDir>$(BuildDir)$(PremakeAction)\</ActionDir>
28-
<NativeProjectsDir>$(ActionDir)projects\</NativeProjectsDir>
29-
<PackageDir>$(RootDir)artifacts\package\</PackageDir>
30-
<TargetDir>$(OutputPath)</TargetDir>
31-
<LangVersion>9.0</LangVersion>
32-
<WarningLevel>4</WarningLevel>
33-
<DotNetCmd>dotnet</DotNetCmd>
34-
<GeneratorFileExtension>dll</GeneratorFileExtension>
35-
<DotNetCmd Condition="'$(PlatformTarget)' == 'x86' AND Exists('$(MSBuildProgramFiles32)\dotnet\dotnet.exe')">"$(MSBuildProgramFiles32)\dotnet\dotnet.exe"</DotNetCmd>
36-
<DotNetCmd Condition="'$(PlatformTarget)' == 'x64' AND Exists('$(ProgramW6432)\dotnet\dotnet.exe')">"$(ProgramW6432)\dotnet\dotnet.exe"</DotNetCmd>
37-
<RID Condition="$(IsWindows)">win</RID>
38-
<RID Condition="$(IsLinux)">linux</RID>
39-
<RID Condition="$(IsMacOSX)">osx</RID>
40-
<RID>$(RID)-$(PlatformTarget)</RID>
41-
</PropertyGroup>
42-
43-
<PropertyGroup Condition="'$(CPPSHARP_RELEASE)' != 'true'">
44-
<DebugSymbols>true</DebugSymbols>
45-
<DebugType>full</DebugType>
46-
<Optimize>false</Optimize>
47-
</PropertyGroup>
48-
49-
<PropertyGroup Condition="'$(DotNetCmd)' == 'dotnet' AND $(IsWindows)">
50-
<GeneratorFileExtension>exe</GeneratorFileExtension>
51-
<DotNetCmd></DotNetCmd>
52-
</PropertyGroup>
53-
54-
<Target Name="prepack" DependsOnTargets="Build" Condition="'$(IsPackable)' == 'true' AND '$(Platform)' == 'x64'">
55-
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PackageDir)runtimes\$(RID)\lib\$(GlobalTargetFramework)" />
56-
</Target>
1+
<Project>
2+
<Import Project="build/config.props" />
3+
4+
<PropertyGroup>
5+
<RootDir>$(MSBuildThisFileDirectory)</RootDir>
6+
<Platforms>x86;x64</Platforms>
7+
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
8+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
9+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
10+
<RepositoryUrl>https://github.com/mono/CppSharp</RepositoryUrl>
11+
<RepositoryCommit>$(GITHUB_SHA)</RepositoryCommit>
12+
<Authors>João Matos, Dimitar Dobrev, Jose Torres</Authors>
13+
<Copyright>João Matos, Dimitar Dobrev</Copyright>
14+
<Version>$(NBGV_Version)</Version>
15+
<AssemblyVersion>$(NBGV_AssemblyVersion)</AssemblyVersion>
16+
<AssemblyFileVersion>$(NBGV_AssemblyFileVersion)</AssemblyFileVersion>
17+
<AssemblyInformationalVersion>$(NBGV_AssemblyInformationalVersion)</AssemblyInformationalVersion>
18+
<IsPackable>false</IsPackable>
19+
<BuildDir>$(RootDir)build\</BuildDir>
20+
<ObjDir>$(BuildDir)obj\</ObjDir>
21+
<GenDir>$(BuildDir)gen\</GenDir>
22+
<SrcDir>$(RootDir)src\</SrcDir>
23+
<GlobalTargetFramework>$(TargetFramework)</GlobalTargetFramework>
24+
<BaseIntermediateOutputPath>$(ObjDir)$(MSBuildProjectName)\</BaseIntermediateOutputPath>
25+
<BaseOutputPath>$(RootDir)bin\</BaseOutputPath>
26+
<OutputPath>$(BaseOutputPath)$(Configuration)_$(PlatformTarget)\</OutputPath>
27+
<ActionDir>$(BuildDir)$(PremakeAction)\</ActionDir>
28+
<NativeProjectsDir>$(ActionDir)projects\</NativeProjectsDir>
29+
<PackageDir>$(RootDir)artifacts\package\</PackageDir>
30+
<TargetDir>$(OutputPath)</TargetDir>
31+
<LangVersion>10.0</LangVersion>
32+
<WarningLevel>4</WarningLevel>
33+
<DotNetCmd>dotnet</DotNetCmd>
34+
<GeneratorFileExtension>dll</GeneratorFileExtension>
35+
<DotNetCmd Condition="'$(PlatformTarget)' == 'x86' AND Exists('$(MSBuildProgramFiles32)\dotnet\dotnet.exe')">"$(MSBuildProgramFiles32)\dotnet\dotnet.exe"</DotNetCmd>
36+
<DotNetCmd Condition="'$(PlatformTarget)' == 'x64' AND Exists('$(ProgramW6432)\dotnet\dotnet.exe')">"$(ProgramW6432)\dotnet\dotnet.exe"</DotNetCmd>
37+
<RID Condition="$(IsWindows)">win</RID>
38+
<RID Condition="$(IsLinux)">linux</RID>
39+
<RID Condition="$(IsMacOSX)">osx</RID>
40+
<RID>$(RID)-$(PlatformTarget)</RID>
41+
</PropertyGroup>
42+
43+
<PropertyGroup Condition="'$(CPPSHARP_RELEASE)' != 'true'">
44+
<DebugSymbols>true</DebugSymbols>
45+
<DebugType>full</DebugType>
46+
<Optimize>false</Optimize>
47+
</PropertyGroup>
48+
49+
<PropertyGroup Condition="'$(DotNetCmd)' == 'dotnet' AND $(IsWindows)">
50+
<GeneratorFileExtension>exe</GeneratorFileExtension>
51+
<DotNetCmd></DotNetCmd>
52+
</PropertyGroup>
53+
54+
<Target Name="prepack" DependsOnTargets="Build" Condition="'$(IsPackable)' == 'true' AND '$(Platform)' == 'x64'">
55+
<Copy SourceFiles="$(TargetDir)$(TargetFileName)" DestinationFolder="$(PackageDir)ref\$(GlobalTargetFramework)" Condition="'$(ProduceReferenceAssembly)' == 'true' AND '$(RID)' == 'win-x64'" />
56+
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PackageDir)runtimes\$(RID)\lib\$(GlobalTargetFramework)" />
57+
</Target>
5758
</Project>

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,11 @@ Please see the following resources for more information:
7474

7575
## Community
7676

77-
Feel free to open up issues on Github for any problems you find.
77+
Feel free to open up issues on GitHub for any problems you find.
7878

7979
## Support
8080

81-
For building wrappers and priority support please write to &#99;&#112;&#112;&#115;&#104;&#97;&#114;&#112;&#64;&#112;&#114;&#111;&#116;&#111;&#110;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;.
82-
Alternatively, you may post bounties at https://www.bountysource.com/.
81+
If you need commercial support feel free to open a discussion or issue for discussion.
8382

8483
## Users
8584

@@ -109,4 +108,6 @@ CppSharp is used by the following projects:
109108

110109
[GLFW3.NET](https://github.com/realvictorprm/GLFW3.NET)
111110

111+
[DearImguiSharp](https://github.com/Sewer56/DearImguiSharp)
112+
112113
Please feel free to send us a pull request adding your own projects to the list above.

examples/SDL/SDL.cs

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public void Preprocess(Driver driver, ASTContext ctx)
5353

5454
ctx.IgnoreEnumWithMatchingItem("SDL_ENOMEM");
5555
ctx.IgnoreFunctionWithName("SDL_Error");
56+
57+
ctx.SetFunctionParameterUsage("SDL_PollEvent", 1, ParameterUsage.Out);
5658
}
5759

5860
public void Postprocess(Driver driver, ASTContext ctx)

src/AST/ASTContext.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ public enum CppAbi
1010
Itanium,
1111
Microsoft,
1212
ARM,
13+
AArch64,
1314
iOS,
14-
iOS64,
15+
AppleARM64,
1516
WebAssembly
1617
}
1718

src/AST/Template.cs

+6
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ public override string ToString()
304304
/// </summary>
305305
public class ClassTemplatePartialSpecialization : ClassTemplateSpecialization
306306
{
307+
public readonly List<Declaration> Parameters;
308+
309+
public ClassTemplatePartialSpecialization()
310+
{
311+
Parameters = new List<Declaration>();
312+
}
307313
}
308314

309315
/// <summary>

src/AST/TypeExtensions.cs

+11
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,17 @@ public static bool IsDependentPointer(this Type type)
439439
return false;
440440
}
441441

442+
public static bool IsTemplateParameterType(this Type type)
443+
{
444+
if (type is TemplateParameterType or TemplateParameterSubstitutionType)
445+
return true;
446+
447+
if (type is PointerType pt)
448+
return pt.GetFinalPointee() is TemplateParameterType or TemplateParameterSubstitutionType;
449+
450+
return false;
451+
}
452+
442453
public static Module GetModule(this Type type)
443454
{
444455
Declaration declaration;

src/CLI/CLI.cs

+5-25
Original file line numberDiff line numberDiff line change
@@ -206,33 +206,13 @@ static void GetFilesFromPath(string path, List<string> errorMessages)
206206

207207
static void GetGeneratorKind(string generator, List<string> errorMessages)
208208
{
209-
switch (generator.ToLower())
209+
foreach (GeneratorKind generatorKind in GeneratorKind.Registered)
210210
{
211-
case "csharp":
212-
options.Kind = GeneratorKind.CSharp;
213-
return;
214-
case "cli":
215-
options.Kind = GeneratorKind.CLI;
216-
return;
217-
case "c":
218-
options.Kind = GeneratorKind.C;
219-
return;
220-
case "cpp":
221-
options.Kind = GeneratorKind.CPlusPlus;
222-
return;
223-
case "napi":
224-
options.Kind = GeneratorKind.NAPI;
225-
return;
226-
case "qjs":
227-
options.Kind = GeneratorKind.QuickJS;
228-
return;
229-
case "ts":
230-
case "typescript":
231-
options.Kind = GeneratorKind.TypeScript;
232-
return;
233-
case "emscripten":
234-
options.Kind = GeneratorKind.Emscripten;
211+
if (generatorKind.IsCLIOptionMatch(generator.ToLower()))
212+
{
213+
options.Kind = generatorKind;
235214
return;
215+
}
236216
}
237217

238218
errorMessages.Add($"Unknown generator kind: {generator}.");

src/CLI/Generator.cs

+1-16
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public void Postprocess(Driver driver, ASTContext ctx)
198198
public void Run()
199199
{
200200
var messageBuilder = new StringBuilder();
201-
messageBuilder.Append($"Generating {GetGeneratorKindName(options.Kind)}");
201+
messageBuilder.Append($"Generating {options.Kind.Name}");
202202
messageBuilder.Append($" bindings for {GetPlatformName(options.Platform)} {options.Architecture}");
203203

204204
if (options.Cpp11ABI)
@@ -225,20 +225,5 @@ private static string GetPlatformName(TargetPlatform? platform)
225225
return platform.ToString();
226226
}
227227
}
228-
229-
private static string GetGeneratorKindName(GeneratorKind kind)
230-
{
231-
switch (kind)
232-
{
233-
case GeneratorKind.CLI:
234-
return "C++/CLI";
235-
case GeneratorKind.CSharp:
236-
return "C#";
237-
case GeneratorKind.NAPI:
238-
return "N-API";
239-
default:
240-
return kind.ToString();
241-
}
242-
}
243228
}
244229
}

src/CppParser/AST.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,8 @@ ClassTemplatePartialSpecialization::ClassTemplatePartialSpecialization()
793793

794794
ClassTemplatePartialSpecialization::~ClassTemplatePartialSpecialization() {}
795795

796+
DEF_VECTOR(ClassTemplatePartialSpecialization, Declaration*, Parameters)
797+
796798
FunctionTemplate::FunctionTemplate() : Template(DeclarationKind::FunctionTemplate) {}
797799

798800
FunctionTemplate::~FunctionTemplate() {}

0 commit comments

Comments
 (0)