Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions scripts/generate-dotnet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ $ToolPath = Join-Path $RootDir build dotnetgenerator

if (Test-Path $ToolPath) { Remove-Item $ToolPath -Recurse -Force | Out-Null }

dotnet tool install ClangSharpPInvokeGenerator --version 13.0.0-beta1 --tool-path $ToolPath
dotnet tool install ClangSharpPInvokeGenerator --version 21.1.8.4 --tool-path $ToolPath

$MsQuicHeader = Join-Path $RootDir src inc msquic.h
$MsQuicGeneratedSource = Join-Path $RootDir src cs lib msquic_generated.cs

$LicenseHeader = Join-Path $RootDir src cs LicenseHeader.txt

$ToolExe = Join-Path $ToolPath ClangSharpPInvokeGenerator.exe
$ToolCmd = Join-Path $ToolPath ClangSharpPInvokeGenerator.cmd

$Arguments = @(
"-f $MsQuicHeader", # Header to parse
"-n Microsoft.Quic", # Namespace to place generated code in
"-o $MsQuicGeneratedSource", # Output file
"-m MsQuic", # Class to place global functions and definitions in
"-l msquic", # Library to import for functions
"-c exclude-enum-operators", # Exclude enum operators from generated
"-g enum-operators=false", # Exclude enum operators from generated
"-r _SOCKADDR_INET=QuicAddr", # Remap _SOCKADDR_INET to QuicAddr
"-c generate-macro-bindings", # Generate values for macros (Such as status codes)
"-h $LicenseHeader", # Add license header to file
"-g macro-bindings", # Generate values for macros (Such as status codes)
"-hf $LicenseHeader", # Add license header to file
"-e QUIC_UINT62_MAX", # Exclude QUIC_UINT62_MAX from generator
"-e MsQuicOpen2", # Exclude MsQuicOpen2 macro from generator
"-e QUIC_API_VERSION_1", # Exclude v1 API define
Expand All @@ -54,7 +54,7 @@ $Arguments = @(

$FullArgs = $Arguments -join " "

Invoke-Expression "$ToolExe $FullArgs"
Invoke-Expression "$ToolCmd $FullArgs"

(Get-Content $MsQuicGeneratedSource) `
-replace '\(anonymous struct.+\)\"', "(anonymous struct)`"" `
Expand Down
4 changes: 2 additions & 2 deletions src/cs/lib/msquic.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<RootNamespace>Microsoft.Quic</RootNamespace>
<LangVersion>9.0</LangVersion>
<LangVersion>12.0</LangVersion>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
Expand Down
Loading
Loading