diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 837be068..466fce59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,9 @@ jobs: - os: windows-2019 name: win-x64 param: -x64 + - os: windows-2019 + name: win-arm64 + param: -arm64 - os: ubuntu-20.04 name: linux-x64 - os: ubuntu-20.04 diff --git a/UpdateLibgit2ToSha.ps1 b/UpdateLibgit2ToSha.ps1 index bf6ead69..e78cd534 100644 --- a/UpdateLibgit2ToSha.ps1 +++ b/UpdateLibgit2ToSha.ps1 @@ -109,6 +109,7 @@ Push-Location $libgit2Directory + diff --git a/build.libgit2.ps1 b/build.libgit2.ps1 index a68a38a3..c428c4f9 100644 --- a/build.libgit2.ps1 +++ b/build.libgit2.ps1 @@ -6,16 +6,19 @@ .PARAMETER debug If set, build the "Debug" configuration of libgit2, rather than "Release" (default). .PARAMETER x86 - If set, the 32-bit version will be built. + If set, the x86 version will be built. .PARAMETER x64 - If set, the 64-bit version will be built. + If set, the x64 version will be built. +.PARAMETER arm64 + If set, the arm64 version will be built. #> Param( [switch]$test, [switch]$debug, [switch]$x86, - [switch]$x64 + [switch]$x64, + [switch]$arm64 ) Set-StrictMode -Version Latest @@ -24,6 +27,7 @@ $projectDirectory = Split-Path $MyInvocation.MyCommand.Path $libgit2Directory = Join-Path $projectDirectory "libgit2" $x86Directory = Join-Path $projectDirectory "nuget.package\runtimes\win-x86\native" $x64Directory = Join-Path $projectDirectory "nuget.package\runtimes\win-x64\native" +$arm64Directory = Join-Path $projectDirectory "nuget.package\runtimes\win-arm64\native" $hashFile = Join-Path $projectDirectory "nuget.package\libgit2\libgit2_hash.txt" $sha = Get-Content $hashFile $binaryFilename = "git2-" + $sha.Substring(0,7) @@ -113,7 +117,7 @@ try { cd build if ($x86.IsPresent) { - Write-Output "Building 32-bit..." + Write-Output "Building x86..." Run-Command -Fatal { & $cmake -G "Visual Studio 16 2019" -A Win32 -D ENABLE_TRACE=ON -D USE_SSH=OFF -D "BUILD_CLAR=$build_clar" -D "LIBGIT2_FILENAME=$binaryFilename" .. } Run-Command -Fatal { & $cmake --build . --config $configuration } if ($test.IsPresent) { Run-Command -Quiet -Fatal { & $ctest -V . } } @@ -127,7 +131,7 @@ try { } if ($x64.IsPresent) { - Write-Output "Building 64-bit..." + Write-Output "Building x64..." Run-Command -Quiet { & mkdir build64 } cd build64 Run-Command -Fatal { & $cmake -G "Visual Studio 16 2019" -A x64 -D THREADSAFE=ON -D USE_SSH=OFF -D ENABLE_TRACE=ON -D "BUILD_CLAR=$build_clar" -D "LIBGIT2_FILENAME=$binaryFilename" ../.. } @@ -141,6 +145,21 @@ try { Run-Command -Quiet -Fatal { & copy -fo * $x64Directory -Exclude *.lib } } + if ($arm64.IsPresent) { + Write-Output "Building arm64..." + Run-Command -Quiet { & mkdir buildarm64 } + cd buildarm64 + Run-Command -Fatal { & $cmake -G "Visual Studio 16 2019" -A ARM64 -D THREADSAFE=ON -D USE_SSH=OFF -D ENABLE_TRACE=ON -D "BUILD_CLAR=$build_clar" -D "LIBGIT2_FILENAME=$binaryFilename" ../.. } + Run-Command -Fatal { & $cmake --build . --config $configuration } + if ($test.IsPresent) { Run-Command -Quiet -Fatal { & $ctest -V . } } + cd $configuration + Assert-Consistent-Naming "$binaryFilename.dll" "*.dll" + Run-Command -Quiet { & rm *.exp } + Run-Command -Quiet { & rm $arm64Directory\* -ErrorAction Ignore } + Run-Command -Quiet { & mkdir -fo $arm64Directory } + Run-Command -Quiet -Fatal { & copy -fo * $arm64Directory -Exclude *.lib } + } + Write-Output "Done!" } finally { diff --git a/nuget.package/build/net46/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/net46/LibGit2Sharp.NativeBinaries.props index 1da2c35c..3edceee5 100644 --- a/nuget.package/build/net46/LibGit2Sharp.NativeBinaries.props +++ b/nuget.package/build/net46/LibGit2Sharp.NativeBinaries.props @@ -7,6 +7,7 @@ +